I´m trying to compare the rows, with the current date and hour,
$curDate = date("Y-m-d H").':00:00';
$query = "SELECT Id FROM Programacao WHERE Data1 = $curDate OR Data2 = $curDate OR Data3 = $curDate
OR Data4 = $curDate OR Data5 = $curDate OR Data6 = $curDate OR Data7 = $curDate";
$result = mysql_query($query);
if(!$result) {echo 'No program today';}
while ($row = mysql_fetch_array($result))
{
echo $row['Id'];
}
The row data in the database is like that: “2011-09-10 18:00:00”
But i always get : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
any corrections?
will give you error needed to know what is wrong
in your case, you’ve forgotten quotes around dates
this one is better and will probably work