Hello,
On my website, I am generating dates in a while loop, counting from a start date until today's date like this:
$datum = date("Y-m-d");
$begindatum="2002-09-15";
$einddatum=$datum;
$nextday = nextDate($begindatum);
while ($nextday != $einddatum){
echo $nextday;
}
Now with each date, I do a database query, to see if any actions have taken place on that date in the database. If so, I print the number of actions. In that same query, I also look for the weekday number of each date:
"SELECT datum, DATE_FORMAT(datum,'%w'), COUNT(*) FROM xxxx WHERE datum == '$begindatum' GROUP BY datum ORDER BY datum ASC"
Now when DATE_FORMAT = 0 or 6 (weekend), I want to print the date in red, otherwise in black. Problem is, as long as I find a result in the database (i.e. an action has taken place), a weekday number is returned. But if no action has taken place, I don't get a weekday number in return (which is what I need).
Anyone, please????