The code you have here isn't really enough to see what the problem is. The error you point to is a problem with the $result variable, not what follows. From: teacherweeks [mailto:teacherweeks@xxxxxxxxx] Sent: Monday, June 11, 2007 1:45 PM To: php-objects@xxxxxxxxxxxxxxx Subject: Error I dont understand I am getting an error on a line of code that I don't understand and I am hoping that someone can explain it to me. I will include the error and line of code that it is telling me is the problem. Weeks Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource. while($row = mysql_fetch_array($result)){ // Increment the total cost of all items $totalCost += ($row["qty"] * $row["itemPrice"]); [Non-text portions of this message have been removed]