RE: [PHP] Populating form value fields.

From: Date: Wed, 11 Dec 2002 15:34:00 +0000
Subject: RE: [PHP] Populating form value fields.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-127833@lists.php.net to get a copy of this message
Cheers Jason. Sorted. Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com stephen.jackson@violasystems.com Mobile +358 50 343 5159 > -----Original Message----- > From: Jason Wong [mailto:php-general@gremlins.biz] > Sent: 11. joulukuuta 2002 17:17 > To: php-general@lists.php.net > Subject: Re: [PHP] Populating form value fields. > > > On Wednesday 11 December 2002 23:18, Steve Jackson wrote: > > I am having problems populating form fields. Here is my code: > > //$ItemCode is passed to the page with this code $mysql = > > mysql_query("SELECT * FROM products WHERE ItemCode='$ItemCode'"); > > $result = mysql_query($mysql); > > > > Then the form: > > <form action="eshop_editprodprocess.php" method="post"> > > <input > > type="text" name="ItemName" value="<?=$ItemName;?>" > > size="18" > > class="kapea"> <input type="text" name="ItemCode" > > value="<?=$ItemCode;?>" size="18" class="kapea"> > > <input type="text" name="ItemDesc" > > value="<?=$ItemDesc;?>" size="18" > > class="kapea"> > > </form> > > > > I have tried numerous ways to use $result to get these values to > > appear but am stuck. How therefore do I select everything from the > > database sorted by ItemCode and then displayed in a form as shown > > above. > > You need to use one of the mysql_fetch_*() functions. See > examples in manual. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications > Development * > > /* > Prediction is very difficult, especially of the future. > - Niels Bohr > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#127833) next »