Hi, I see that you people are not understanding the error. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource. There is no data table returned by the mysql, or either the database connection is not properly made. First check whether the sql query formed is correct or not. Then check if there is some data to be returned. Alternately you can check mysql_num_rows, before mysql_fetch_array. Bye, Manda Krishna Srikanth http://www.ksjournal.info php-objects@xxxxxxxxxxxxxxx wrote on 06/12/2007 02:30:09 PM: > Hi, > U can try this with numeric index in place of string index. > eg. $totalCost += ($row[0] * $row[1]); > > --- In php-objects@xxxxxxxxxxxxxxx, "teacherweeks" <teacherweeks@...> > wrote: > > > > 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"]); > > =====-----=====-----===== Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you [Non-text portions of this message have been removed]