Hi,
I am having a problem with a query I'm running through php. If I paste the query into the SQL window in phpAdmin it works fine.
The php code is:
$sql_statement = "SELECT COUNT(*) FROM SESSION WHERE session_exp >= NOW()";
Then I have a db call to
$result=mysql_query($sql_statement, $db_link);
I have changed the $sql_statement value and run all kinds of other queries. The query doesn't error out. But it returns zero and I know the count should be one. In fact if I cut and paste the same query above into the SQL window in phpAdmin it works fine, I get one column called COUNT(*) and it's value is 1.
I have even run other count queries with no problem. Somehow I think NOW() needs to be in quotes or someting?
Has anyone ran a mysql_query using a variable with NOW() in it?
Thanks In Advance.....
Vmusic