Re: Forms Question
| From: | Bas Jobsen | Date: | Wed, 05 Sep 2001 21:43:23 +0000 |
| Subject: | Re: Forms Question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-12190@lists.php.net to get a copy of this message | ||
> Hello,
> Here is the code I have:
sure, your query is something like:
select ..., store, jobdesc ...... FROM ......
why using:
> $store=$row["store"];
> $jobdesc=$row["jobdesc"];
echo"dhdhdh".$row["store"]."blabla" would also work
i should use:
while (LIST($store,$jobdesc)=mysql_fetch_row($result)) {
.
----- Original Message -----
From: "Jeff Grossman" <jeff@stikman.com>
To: <php-db@lists.php.net>
Sent: Wednesday, September 05, 2001 11:50 PM
Subject: [PHP-DB] Forms Question
> Hello,
> Here is the code I have:
>
> while ($row=mysql_fetch_array($result)) {
> $store=$row["store"];
> $jobdesc=$row["jobdesc"];
> echo "<FORM METHOD=post ACTION=update.php>";
> echo "<P>Store:
> <Select NAME=\"$store\">
> <option VALUE=\"Signal Hill\">Signal Hill
> <option VALUE=\"Reseda\">Reseda
> <option VALUE=\"Orange\">Orange
> <option VALUE=\"West Covina\">West Covina
> <option VALUE=\"Riverside\">Riverside
> <option VALUE=\"Norwalk\">Norwalk
> <option VALUE=\"Fountain Valley\">Fountain Valley
> <option VALUE=\"Pasadena\">Pasadena
> <option VALUE=\"Redondo Beach\">Redondo Beach
> <option VALUE=\"San Bernardino\">San Bernardino
> <option VALUE=\"Kearny Mesa\">Kearny Mesa
> <option VALUE=\"San Marcos\">San Marcos
> <option VALUE=\"Chino\">Chino
> <option VALUE=\"Coporate Office\">Corporate Office
> </select></P>";
> echo "<P><INPUT TYPE=text SIZE=35 NAME=\"Jobdesc\"
> VALUE=\"$jobdesc\"></P>";
> echo "<p><INPUT TYPE=submit VALUE=\"submit\" LABEL=\"Save
> Changes\"></P>";
> }
>
>
> Is want I am trying to do possible? I want the value which is stored in
> $store to automatically fill in on the drop down list. But, for some
> reason it is defaulting to the first option, and not using the value
> that is in the database.
>
> Can I use a drop down menu, or should I just go to radio buttons?
>
> Thanks,
> Jeff
>
> --
> Jeff Grossman (jeff@stikman.com)
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>