Publisher review:How to populate a HTML DropDown box script demonstrates how to query an access database in order to populate a dropdown box. This example uses a table 'tblFriends' in an Access database 'Friends.mdb'. The table has 3 columns, firstly an 'ID' field which is an autonumber, secondly a field called 'FirstName' which is a textfield and lastly another textfield called 'SurName'.
The SQL statement uses the wildcard % and looks for those records where the FirstName's first letter begins with a T and populates the drop down with the records returned. If the form has not been submitted then the dropdown list will be displayed and if it is submitted then the selected option will be displayed.
If there are no records that begin with the T (i.e. If oRecordset.Eof) then the drop down box will show "No Suitable Options" and if submitted the page will display "No suitable option was selected."
How to populate a HTML DropDown box is a PHP script for Snippets scripts design by Michael Wall.
It runs on following operating system: Windows.
demonstrates how to query an access database in order to populate a dropdown box.
Operating system:Windows