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 Quote 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']}"; Quote Link to comment https://forums.phpfreaks.com/topic/259348-help-with-drop-menu/#findComment-1329511 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.