I'm using CodeIgniter with php5.6
public function getUserAge($uid=''){
$today = date('Y-m-d');
$res = $this->db->select("age(dob, '$today') as age")->from('users')->where(array('user_id' => $uid))->get()->row_array();
return $res['age'];
}
but I get error.
A Database Error Occurred Error Number: 1305
FUNCTION tblname.age does not exist
SELECT age('dob', '2019-02-11') as age FROM
users
WHEREuser_id
= 53Filename: modules/account/models/Account_model.php
Line Number: 142