I need to make a search query, where a user can search by name or course or year or member, any one of above and also the user cam make a search with all the field or any number of field, e.g.;-as only with name & course.
How it is possible? I don't want to make different query, can it be possible with a single query? now my query is:
$query="SELECT * FROM fsb_profile
WHERE profile_name = '".$_REQUEST['name']."'
AND profile_member= '".$_REQUEST['type']."'
AND profile_year= '".$_REQUEST['year']."'
AND profile_course='".$_REQUEST['course']."'
OR profile_name = '".$_REQUEST['name']."'
OR profile_member= '".$_REQUEST['type']."'
OR profile_year= '".$_REQUEST['year']."'
OR profile_course='".$_REQUEST['course']."'";
but it's not running, it's only searching by any one of the field, how it is possible?