09-09-2008, 08:48 AM
|
#2 (permalink)
|
|
The Prestige
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
|
Does the <textarea> tag have a value attribute? anyway if you want data to be displayed inside a <textarea> then you do it between the opening and closing tags, in your example:
PHP Code:
echo "<textarea name='txtComments' rows='2' cols='20' id='txtComments' value = '<?php $comments ?>'></textarea>";
needs to be changed to :
PHP Code:
echo "<textarea name='txtComments' rows='2' cols='20' id='txtComments' >$comments</textarea>";
there is also no need for '<?php $comments; ?>'.
I do think the retrieving of data could be a little better, the use of both mysql_fetch_assoc and mysql_result i can't understand.
This perhaps is a better way of doing it:
PHP Code:
while ($aRow = mysql_fetch_assoc($result)) { echo "<textarea name='txtComments' rows='2' cols='20' id='txtComments' >" .$aRow['comments']. "</textarea>"; }
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
|
|
|
|