Page 1 of 1

PHP Help

Posted: Mon Nov 24, 2008 6:21 am
by phpPain
Hi,

I have the following code which will display my data from a database;

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
print("ID: " . $row[0] . " Stock: " . $row[1] . " Desc " . $row[2]);
print ("<br /><br />");

However, I need to get the data to be displayed within textboxes so that it can be edited. At the moment the data is printed out and I can't do anything with it. Would be handy if the titles of each column were in a format that couldn't be edited but the data within the stock column could be edited. Any know how to do this? I am a beginner at PHP as you can tell.

:banghead:

Re: PHP Help

Posted: Mon Nov 24, 2008 7:29 am
by aceconcepts

Code: Select all

 
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo'<textarea name="textarea[]">'.$row['field_name'].'</textare><br />';
}
 

Re: PHP Help

Posted: Mon Nov 24, 2008 1:33 pm
by califdon
You should probably generate an HTML Form so that you can have text areas, as aceconcepts suggested, or (my preference) input boxes. Take a look at: http://www.thesitewizard.com/archive/feedbackphp.shtml and http://www.phpf1.com/tutorial/php-form.html and http://www.tizag.com/phpT/examples/formex.php.