mishuk Posted April 12, 2007 Share Posted April 12, 2007 hi i am working on populating a drop down menu with a select statement and have got so far. The drop down box is populated with value however the value are null. Can anyone help? $query="select distinct(house_type) from tbl_accommodation"; $stmt = ociparse($conn, $query); ociexecute($stmt); echo '<select name="house_type">'; echo '<option value = "-1">Select:</option>'; while($row=ocifetch($stmt)) { echo $row; echo '<option value=' . $row['house_type'] . '>' . $row['house_type'] . '</option>'; } echo '</select>'; Quote Link to comment https://forums.phpfreaks.com/topic/46704-populating-a-drop-down-box-using-values-in-a-table/ Share on other sites More sharing options...
gluck Posted April 13, 2007 Share Posted April 13, 2007 print the result set and see what is returned from database. Quote Link to comment https://forums.phpfreaks.com/topic/46704-populating-a-drop-down-box-using-values-in-a-table/#findComment-228605 Share on other sites More sharing options...
Feenix566 Posted July 3, 2007 Share Posted July 3, 2007 Oracle returns all its results in CAPS. So change it to $row['HOUSE_TYPE'] and you should get the data. Also, start programming with your error reporting set to E_ALL so you can see notices about undefined indexes in the future. Quote Link to comment https://forums.phpfreaks.com/topic/46704-populating-a-drop-down-box-using-values-in-a-table/#findComment-288881 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.