php - Individual options in SQL query -
php - Individual options in SQL query -
i trying figure out how can work variables sql queries.
i using 5 question scheme on 5 different forms, person can find auto suit needs. on of question asked, displayed in dropdown box populated database. need code flexible because items added , removed. know how many companies , model of vehicles there are.
here have tried far.
<select id="bodytype" name="bodytype" style="width:80%"> <option value="all">all styles</option> <?php $sql = mysqli_query($dbcon, "select distinct `type` catalogue `available` = '1' , brand = '$query1'"); while ($row = mysqli_fetch_array($sql)){ echo "<option value=". $row['type'] . ">" . $row['type'] . "</option>"; } ?>
as can see code have placed $query1 brand. problem having if person chooses make, not sure how show in sql. drop , brand = '$query1' on 5 forms have write load of if/else statements.
i asking:
is there way have php insert or remove part dynamically? there symbol can use? know * find records there similar can used in , section of query?
i give thanks time , hope have been clear.
greg
php mysql
Comments
Post a Comment