Display values from a table to a text zone in html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phpDVWeaver
Forum Commoner
Posts: 28
Joined: Sun Apr 29, 2007 11:00 pm

Display values from a table to a text zone in html

Post by phpDVWeaver »

I do have an set of data in a mysql query. is there any way to assign these values to a set of text zone in an thml page

Thanks
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

No idea what you've asked.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Display values from a table to a text zone in html

Post by superdezign »

phpDVWeaver wrote:I do have an set of data in a mysql query. is there any way to assign these values to a set of text zone in an thml page

Thanks
No.

But if you had a set of data in your MySQL result, and tried to add those values into a textarea on an HTML page, then maybe. :wink:
phpDVWeaver
Forum Commoner
Posts: 28
Joined: Sun Apr 29, 2007 11:00 pm

Post by phpDVWeaver »

Sorry if I did not explain enough.
I have a website where I enter info regarding student, and then save it in a mysql database.
I am trying to design a page to update rcords. Meaning Once I logon, a Mysql query is executed to select all the info where the logon is right.
What I want is once this query is run. I want to display it in the HTML form that I used to enter this data at first time.

Thanks
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

What have you tried so far?
phpDVWeaver
Forum Commoner
Posts: 28
Joined: Sun Apr 29, 2007 11:00 pm

Post by phpDVWeaver »

I already Have the logon form and the query that select a set of information if the logon is right.
I need to assign this set of information to a temporary set of variables, and then assign this set of temporary variables to the text zone inputs that used to enter this information initialy.

any idea.

Thanks
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Oh yeah, it's clear as to what you are trying to do. You've explained it pretty well. :wink:

I mean, code-wise, what have you tried?
phpDVWeaver
Forum Commoner
Posts: 28
Joined: Sun Apr 29, 2007 11:00 pm

Post by phpDVWeaver »

thanks for the reply.
the query is working.
to asign the result of the query to the taxt zone. I wa thinking of something similar to :
<input type="text" name="fname" style="background-color: #cccccc; font-size: 16px" size="30" maxlength="30" value= "<?php $_POST['fname']?>;">

the problem with this is that it does not take in consideration the database..

any idea?

thanks again.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Query the database. Use the result as an array that is fed into the form fields.

Code: Select all

<?php
// I'll leave it up to you to get here
$member = mysql_fetch_array($result);
?>
<input type="text" name="memberName" value="<?php echo $members['memberName']; ?>" />
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Oh yeah, this thread has been moved to PHP - Code for obvious reasons.
phpDVWeaver
Forum Commoner
Posts: 28
Joined: Sun Apr 29, 2007 11:00 pm

Post by phpDVWeaver »

thanks a lot man that was what I've been looking for. :idea: :rofl:
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Glad we could help.
Post Reply