this code
<?php
include 'partners/db.php';
$id=111;
$date1=2004-08-01;
$date2=2004-08-04;
$query="SELECT date, total, u_total, r_total FROM history WHERE id='$id' AND date>='$date1' AND date<='$date2'";
mysql_query($query) or die("Update eror: ".mysql_error());
while ($result = mysql_fetch_array($query, MYSQL_ASSOC)) {
echo $result["total"];
}
?>
is giving this error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/fking/public_html/xxxxxx.com/test2.php on line 8
and i can't figure out why...