ive got few client list with DOB format yyyy-mm-dd.
how do i search client by their Date of birth, even if i enter either year or month or date first, it will show the result.
at the moment, i need to use format yyyy-mm-dd to search them.
$result = $db->query("SELECT f_name, l_name, dob, email FROM user WHERE dob LIKE'$keyword%' OR f_name LIKE '$keyword%' OR l_name LIKE '$keyword%' LIMIT 100")
if($result) {
if($db->affected_rows()!= 0){
// echo the result
}
}
affected_rowsreturns the rows affected by an INSERT, DELETE, REPLACE or UPDATE statement. Not from SELECT, though.