beastylad Posted March 20, 2012 Share Posted March 20, 2012 Hi i currenlty have adrop box filled with companies so the user can select which company they woudl like services from but the default is currently 0 and is to selecvt all firms but im unsure how to do this. Current code: <td>Taxi Firm</td><td> <select name="taxifirm"> <option value="0" selected>All Taxi Firms</option> <?php $sql = mysql_query("SELECT * FROM taxi_Firms"); while($row = mysql_fetch_array($sql)){ $uid = $row["Firm_ID"]; $username = $row["Firm_Name"]; echo '<option value="'.$uid.'">'.$username.'</option>' ; } ?> amny help is welcomed thanx Link to comment https://forums.phpfreaks.com/topic/259348-help-with-drop-menu/ Share on other sites More sharing options...
Muddy_Funster Posted March 20, 2012 Share Posted March 20, 2012 conditional generation of the where clause? if($_POST['taxifirm'] == 0){ $where = ''; } else{ $where = "WHERE Firm_ID = {$_POST['taxifirm']}"; Link to comment https://forums.phpfreaks.com/topic/259348-help-with-drop-menu/#findComment-1329511 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.