PHP Help

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
phpPain
Forum Newbie
Posts: 10
Joined: Mon Nov 24, 2008 6:14 am

PHP Help

Post 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:
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: PHP Help

Post by aceconcepts »

Code: Select all

 
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo'<textarea name="textarea[]">'.$row['field_name'].'</textare><br />';
}
 
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: PHP Help

Post 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.
Post Reply