View Single Post
  #6 (permalink)  
Old February 4th, 2004, 02:06 PM
nikolai nikolai is offline
Friend of Wrox
Points: 1,708, Level: 16
Points: 1,708, Level: 16 Points: 1,708, Level: 16 Points: 1,708, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA.
Posts: 833
Thanks: 0
Thanked 0 Times in 0 Posts
Default

"Throwing away one of your result rows" means exactly what it sounds like.  You get a result row and overwrite it without ever using the values from it.

Here's your code, with irrelevant parts trimmed out:


$viewall = query((snip), $link, __LINE__, __FILE__);
$senarai = mysql_fetch_array($viewall);

if (empty($senarai))
{
    (snip)
}
else
{
    $bil = 1;
    while ($senarai = mysql_fetch_array($viewall))
    {
        (snip)
    }
   (snip)
}


Look at what you're doing.  You're getting a row of data from your "viewall" query, but you never use the data in that row -- you throw it away when you start your while() loop because you overwrite the value by getting the next row in the result set.


Take care,

Nik
http://www.bigaction.org/
Reply With Quote