I Have a Mysql with the rows Data1,data2,data3…Data7 and i want to compare with the current date,searching the internet i got this so far:
$curDate = date("Y-m-d");
$query = "SELECT Id FROM Programacao where Data1 = $curDate";
$result = mysql_query($query);
if(!$result) {echo 'Nada';}
while ($row = mysql_fetch_array($result))
{
echo "Id = ".$row ['Id'];
}
But i can read only the first one,does it possible to compare all of them at the same time?
You should use logic operators. If you need check that AT LEAST ONE of
Datais$curDateYou should replace
orbyandif you need to check that ALL OF THEM are OK.Besides, As far as I remember You should use Date values in quotes, so correct one is