MySQL query cache and PHP variables
- by Saif Bechan
I have seen the following statement made about the query cache:
// query cache does NOT work
$r = mysql_query("SELECT username FROM user WHERE signup_date >= CURDATE()");
// query cache works!
$today = date("Y-m-d");
$r = mysql_query("SELECT username FROM user WHERE signup_date >= '$today'");
So the query cache only works on the second…