Hi i am trying to select weeks from the whole of last year and then total all the info in each week and print out weekly sales stats.
unfortunatly my crappy script is showing me every week from today to exactly a year from now and not doing any calculations either!!
any one got any iideas??
$date = 2005-01-01;
$x = 0;
while ($x < 53) {
$yesterdays_takings = mysql_query ("SELECT * FROM arcade_takings WHERE date = '$date'");
while($row = @mysql_fetch_array($yesterdays_takings))
$cash = ( $row[cash]);
$chq = ( $row[chq]);
$card = ( $row[card]);
$total = ($total + $card + $cash + $chq);
$yesterday = date("l d F Y", strtotime("$x week"));
print ("<tr><td>$yesterday</td><td>£$total</td></tr>");
$x++;[/QUOTE]
thanks a bunch
Ben