My updated
field is a DATETIME and that is what I want it to be.
$date = '2020-03-24';
$sql = "
SELECT * FROM test
WHERE DATE_FORMAT(updated, '%Y-%m-%d') = " . $date. "
";
$stmt = $db->query($sql);
$rows = $stmt->fetchAll();
I get an empty result when doing the above.
Question
How can I get the results where the date is from $date
no matter what the time is? If I could use PHP I could use substr but this is not possible in sql.