The easiest way is probably to select all shop, dates, where takings = 0 then in your php logic test the condition that day of week is not 7.
PHP Code:
// emulating your results set from your SQL
$rows[] = array( "shop" => "City centre", "takings" => 0, "day"=>"2010-05-02" );
$rows[] = array( "shop" => "City centre", "takings" => 0, "day"=>"2010-05-03" );
foreach( $rows as $row){
if( // check the day is not number 7
( date( 'N' , strtotime( $row['day']) ) != 7 )
)
{
echo 'oops, missed one ... ' . $row['shop'] . ' on ' . $row['day'] ;
}
}
// oops, missed one ... City centre on 2010-05-03
There may be a way to do it in your SQL select, but ask that question on one of the dedicated sql forums.
Best way though would be to automate the inputting of takings somehow ...
Bookmarks