contraboybish Posted December 5, 2009 Share Posted December 5, 2009 Ok mr Newbie here is trying to populate a dropdown list, but it wont populate, here is the code so far....... <div class="pageheader">Warehouse Property Page</div><br /> <?php require_once('../App_Data/odbc_open.php'); $query = odbc_exec($odbc, "SELECT DISTINCT country FROM sheds") or die (odbc_errormsg()); ?> <form action="action" method="post"> <select name="option"> <?php while($row = odbc_fetch_array($query)) { echo "<option value='$row[country]'>"; } odbc_close($odbc); ?> </select> </form> </div> Can someone tell me how stupid l am and correct this? :-) Bish Link to comment https://forums.phpfreaks.com/topic/184116-populating-a-dropdown-list-via-ms-access/ Share on other sites More sharing options...
rajivgonsalves Posted December 5, 2009 Share Posted December 5, 2009 this echo "<option value='$row[country]'>"; should be something like this echo "<option value='$row[country]'>$row[country]</option>"; Link to comment https://forums.phpfreaks.com/topic/184116-populating-a-dropdown-list-via-ms-access/#findComment-972076 Share on other sites More sharing options...
contraboybish Posted December 5, 2009 Author Share Posted December 5, 2009 That's it... woo hoo... many thanks!! :-) Link to comment https://forums.phpfreaks.com/topic/184116-populating-a-dropdown-list-via-ms-access/#findComment-972083 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.