Re: retrieve a cell
| From: | Rasmus Lerdorf | Date: | Fri, 21 Jul 2000 22:23:54 +0000 |
| Subject: | Re: retrieve a cell | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1417@lists.php.net to get a copy of this message | ||
> How do I retrive a variable if I use a form and I want to pass a
> selected row to another page. the row contains 2 field. I want want to
> retrieve the field[0]. What is the function/format to retieve my
> variable
>
> echo "<form method=POST action=choix.php>
> <p><select name=choix size=15>\n";
>
> while ($myrow = mysql_fetch_row($result)){
> echo "<option>" .$myrow[0]."\t".$myrow[1];
> }
>
> so how can I retrieve the variable $myrow[0] in choix.php or the all
> line selected
Change your loop to:
while ($myrow = mysql_fetch_row($result)){
echo "<option value=".$myrow[0].">"
.$myrow[0]."\t".$myrow[1];
}
and then just access it as $choix
Otherwise you could use:
list($arg1,$arg2) = explode("\t",$choix);
$arg1 would by $myrow[0]
-Rasmus