I once read on a performance blog that it’s better to use PHP date functions to set dates in a MySQL query instead of using mysql date functions like curdate (), because mysql can cache the query or result or something like that, Someone can anyone understand this? Does he have any water or is it unreasonable?
Example:
$query = 'SELECT id FROM table WHERE publish_date = \''.date('Ym-d').'\'';
against
$query = 'SELECT id FROM table WHERE publish_date = CURDATE()';
date php mysql query-cache
dqhendricks
source share