I have a search problem when searching on gender.... when i search for male.... i also get females in my search results... how do i solve this problem ... here's the code below. In my database i have a field name student_gender and the values are 'male' or 'female'
// Use like to match with the % wildcards;
$ses_organization= $_SESSION['organization_id'];
$result = mysql_query("SELECT `student_id`, `student_first_name`, `student_last_name`, `student_gender`, `organization_id`, `group_id` FROM `students` WHERE organization_id='$ses_organization' AND status='1' AND `$type` LIKE '%$search%' ORDER BY `$type` ASC LIMIT 30");
$totalresults = mysql_num_rows($result);
Plz help.. thanks