At my current database i use date format yyyy-mm-dd.
If i want to search by DOB then must use format yyyy-mm-dd to match it with default date format.
Is there a way to search DOB from whatever user input wether its dd-mm-yyyy or dd/mm/yyyy or yyyy-mm-dd and give out the result???
$keyword = clean($keyword,1);
$result = $db->query("SELECT name, dob, email FROM user WHERE name LIKE '$keyword%' OR dob LIKE '$keyword%' OR email LIKE '$keyword%'");
if($result){
//echoing the result
}
Not easily. First convert the user input to the correct format before passing it to the SQL query.
For example: