ask9 Posted October 1, 2009 Share Posted October 1, 2009 Hello guys i have this advacned search option below, http://czone01.com/ztest/advance_option.jpg now i want those option to be included in one search query of MySQL. Can you show me sample of query for this advance search option please. Thank you. Link to comment https://forums.phpfreaks.com/topic/176174-advanced-search-option/ Share on other sites More sharing options...
cags Posted October 1, 2009 Share Posted October 1, 2009 Entirely depends on your database and HTML but a basic example is something along the lines of... $sql = " SELECT * FROM `table` WHERE `state`='". $_POST['state'] . "' AND `City` LIKE '%" . $_POST['city'] . "%' AND `gender`='" . $_POST['gender'] . "' AND `ethnicity`='" . $_POST['ethinicity'] . "'"; Age Range will depend on how you store the ranges in the dropdown and how you store the ages in the database, you might well have to set up a switch statement/if block. Interested in will also depend how it's kept in the database. Link to comment https://forums.phpfreaks.com/topic/176174-advanced-search-option/#findComment-928407 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.