Page 1 of 1

Display values from a table to a text zone in html

Posted: Sun Jun 03, 2007 1:47 pm
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

Posted: Sun Jun 03, 2007 1:56 pm
by John Cartwright
No idea what you've asked.

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

Posted: Sun Jun 03, 2007 4:33 pm
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:

Posted: Sun Jun 03, 2007 9:35 pm
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

Posted: Mon Jun 04, 2007 7:04 am
by superdezign
What have you tried so far?

Posted: Mon Jun 04, 2007 10:15 am
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

Posted: Mon Jun 04, 2007 12:56 pm
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?

Posted: Mon Jun 04, 2007 1:50 pm
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.

Posted: Mon Jun 04, 2007 6:42 pm
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']; ?>" />

Posted: Mon Jun 04, 2007 6:43 pm
by RobertGonzalez
Oh yeah, this thread has been moved to PHP - Code for obvious reasons.

Posted: Mon Jun 04, 2007 7:29 pm
by phpDVWeaver
thanks a lot man that was what I've been looking for. :idea: :rofl:

Posted: Mon Jun 04, 2007 7:33 pm
by RobertGonzalez
Glad we could help.