hi i have to develop a form which takes user age and calculates age and if over 18 procedds to take him to registeration form
my question is has i am using zend framework how to implement it when its not supposed to interact with model much and their is no data in database
how can i validate age of the person
i m trying to use this code
$data = array ( 'dob' => date ( "Y-m-d" ));
$select = $db
->select()
->from('data', array(
'id',
'age' => new Zend_Db_Expr("DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(dob)), '%Y')+0")))
can i use an array ? please help me friendshow should be this query
I don't quite understand your question... Are you having trouble calculating the age from a DOB?
If so, this should take care of your problem: