Article 5M1VJ Showing <textarea> value in <form> (value from php)

Showing <textarea> value in <form> (value from php)

by
pizzipie
from LinuxQuestions.org on (#5M1VJ)
<textarea> values came from a query of my Database:
$query="SELECT * from hdata WHERE Id=".$recId.";";
part of the hdata returned data is - $row['tests'], $row['results'], $row['notes']

I want these values to show up in my <form>> So I have a chance to edit them if I want.

Code:<form>

...... Other input data .....

<textarea name='tests' id='tests' rows="3" cols="40" value='<?php echo $row[tests]; ?>'></textarea><br>

<textarea name='results' id='results' rows="3" cols="40" value='<?php echo $row[results]; ?>'></textarea><br>

<textarea name='notes' id='notes' rows="3" cols="40" value='<?php echo $row[notes]; ?>'></textarea><br>

</form>I know that <textarea> doesn't have a 'value' attribute so how do I accomplish setting the <form> <textarea>'s to show the php values?

See Insert to show what this code does. NOTE: Not using ' ' around tests. results, and notes.

Attached Thumbnailsattachment.php?attachmentid=36765&stc=1& latest?d=yIl2AUoC8zA latest?i=xG4YA56Jh2g:4lQv1ZzNhnc:F7zBnMy latest?i=xG4YA56Jh2g:4lQv1ZzNhnc:V_sGLiP latest?d=qj6IDK7rITs latest?i=xG4YA56Jh2g:4lQv1ZzNhnc:gIN9vFwxG4YA56Jh2g
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments