This is my query to search the data base for candidates who meet a certain criteria. I am using php, mysql, html
$Odata = mysql_query("SELECT * FROM p_candidate WHERE(`gender` LIKE '%".$Gender."%')
AND (`verbal` LIKE '%".$Verbal."%') AND(`waiver` LIKE '%".$Waiver."%')
AND(`waiver_type` LIKE '%".$W_Type."%') AND(`sel_staff` LIKE '%".$A_Staff."%')
AND(`sel_peers` LIKE '%".$A_Peers."%')AND(`verbal` LIKE '%".$Awake."%')
AND(`ambulatory` LIKE '%".$Ambulatory."%') AND(`function` LIKE '%".$Function."%')"
) or die(mysql_error());
There is another criteria I want to add - Adult/Child. I have date of birth as a column in the DB. If the candidate is above 18, would fall under Adult, otherwise Child.
The user may want to search for an adult with all the contents in $Odata. How can I do this?
looking through Calculate Age in MySQL (InnoDb) and Search age range in mysql, php I understand it can be done independently, but how can I incorporate it into my above query. Is that possible?