Re: Error I dont understand

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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"]);
>
>

99%: Your query, has an SQL error...

try:

 $result = mysql_query(...) or die(mysql_error());

 while($row = mysql_fetch_array($result)){
 // Increment the total cost of all items
 $totalCost += ($row["qty"] * $row["itemPrice"]);

-- 
José Miguel Santibáñez
    jms@xxxxxxxxx

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux