Re: Another dynamic sql.
| From: | Lerp | Date: | Mon, 28 Jan 2002 13:24:48 +0000 |
| Subject: | Re: Another dynamic sql. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16246@lists.php.net to get a copy of this message | ||
Your select options have no values associated with them! Not sure if you did
this on purpose or not, but no value will be sent to next page.
Joe :)
"Raymond Lilleodegard" <raymol@online.no> wrote in message
news:20020125184755.13684.qmail@pb1.pair.com...
> Hi all!
>
> I have this form with some choices:
>
> <form>
> Enter how many cars you want:<input type="text" name="number" >
> <select size="1" name="car">
> <option selected>ford</option>
> <option>bmw</option>
> <option>mercedes</option>
> </select>
>
> And then I am trying to get the price out of a table in my database with
> this code:
>
>
> $sql = mysql_query("SELECT '$car' FROM varetabell where carid='$carid'
> ");
> $myrow= mysql_fetch_array($sql);
> $x = $myrow["$car"];
>
> $price = $x * $number;
>
>
> Shouldn't this work? Or am I missing something here?
>
>
>
> Best regards Raymond
>
>