dynamic variables in sq?l

From: Date: Fri, 25 Jan 2002 18:50:58 +0000
Subject: dynamic variables in sq?l
Groups: php.general 
Request: Send a blank email to php-general+get-82142@lists.php.net to get a copy of this message
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

« previous php.general (#82142) next »