search date from age number
Hello again, i been going in circles to find a solution to do a search let me explain i got a table of users
USERTB
name varchar 150
email varchar 150
birthdate date
country varchar 150
Im trying to do a search by age with filters like user from canada that are 20 years old how can i acomplish this with dataassist i have the birthdate field as date and have a function to show on the list how old is the person
displaying the age based on the birth date but how do i do the oposit typing in an age 20 or 30 years old and it displays the users on that range using the data assist search wizard?
function cumple ($cumple){
list($year,$month,$day) = explode("-",$cumple);
$year_diff = date("Y") - $year;
$month_diff = date("m") - $month;
$day_diff = date("d") - $day;
if ($day_diff < 0 || $month_diff < 0)
$year_diff--;
return $year_diff;
}