RE: [SPAM] Re: Error I dont understand

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

 



Hello Dea,

This means in fact that the result of the query could not be acquired.
Either a syntax error in your MySQL-query or no rows in your result-set. The
mysql_num_rows-call can be used to check if you have some rows in your
result-set
This summation can in fact also be solved completely at MySQL-side with the
following statement (example), using the aggregate function SUM:

SELECT SUM(a.itemPrice * d.qty) FROM articles a, deliveries d WHERE a.id =
d.id [additional conditions]

See also http://dev.mysql.com

Best Rgds

Carlo Post - The Netherlands
  -----Original Message-----
  From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx]On
Behalf Of dea andrea
  Sent: dinsdag 12 juni 2007 8:47
  To: php-objects@xxxxxxxxxxxxxxx
  Subject: [SPAM] Re:  Error I dont understand


  Better you make it like this :

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

  try it... hope it'll help.

  ----- Original Message ----
  From: teacherweeks <teacherweeks@xxxxxxxxx>
  To: php-objects@xxxxxxxxxxxxxxx
  Sent: Tuesday, June 12, 2007 3:45:06 AM
  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"]);

  PHP Data object relational mapping generator
  http://www.metastorage.net/
  Yahoo! Groups Links

  __________________________________________________________
  Get the free Yahoo! toolbar and rest assured with the added security of
spyware protection.
  http://new.toolbar.yahoo.com/toolbar/features/norton/index.php

  [Non-text portions of this message have been removed]



  


[Non-text portions of this message have been removed]


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

  Powered by Linux