Hi,
I'm having a problem when executing a query through PHP:
$qry = "SELECT YEAR(Event_Date_DE) AS Year, Event_Description_CH AS Description, Event_Link_CH AS Link ";
$qry .= "FROM OnThisDay ";
$qry .= "WHERE DAYOFMONTH(Event_Date_DE) = DAYOFMONTH(NOW()) AND ";
$qry .= "MONTH(Event_Date_DE) = MONTH(NOW())";
$res = mysql_query($qry);
Note that I first open a connection to the database, and it's opened succesfully. But after executing the query, $res "is not a valid resource", i.e., it's "FALSE".
Now, If I execute the exact same query on phpMyAdmin or MySQLGUI:
SELECT YEAR(Event_Date_DE) AS Year, Event_Description_CH AS Description, Event_Link_CH AS Link
FROM OnThisDay
WHERE DAYOFMONTH(Event_Date_DE) = DAYOFMONTH(NOW()) AND
MONTH(Event_Date_DE) = MONTH(NOW())
I get the desired result...
Does anyone know what I'm doing wrong here?
Thanks in advance.