Hi , I have created a page in my website for searching from database using combo box. thid is the html code i used for creating combo box.. <form method="get"> <select name="year" class="combo-75"> <option value="2009">2009</option> <option value="2008">2008</option> <option value="2007">2007</option> </select> <input type="submit" name="search" value=" Go " class="button" /> </form> Code (markup): How can i search the value from database using php? am not sure about the code...pls help... Thank u....
try this link http://www.webmasterworld.com/php/3422211.htm or google for "php drop down search" for some other result
I'm not sure what part you are having trouble with. It should be very simple. $value = intval($_REQUEST['value']); $sql = "select * from table where value = {$value}"; Code (markup):
You did the html part, and it still the php part. You will need to create a new other file, that will read the combo box value, (with $searchfor = $_POST['nameofcombo']) and search it in the database. But you need to know how to connect to a database. Your database is it mysql ?