From: spock1985 at homail dot com
Operating system: Win Xp
PHP version: 4.3.4
PHP Bug Type: MySQL related
Bug description: While Loops
Description:
------------
When using a while loop such as in the example below:
It skips over the very first entry within the table.
Say I have 5 rows which have a lvl of 3, when printing out the name of
said row, only the last 4 will print out.
Reproduce code:
---------------
mysql_connect (localhost, root, '');
mysql_select_db (Arakaron);
$result=mysql_query ("SELECT * FROM magic WHERE lvl='3'");
$row = mysql_fetch_array($result);
while ($row = mysql_fetch_array($result))
{
print $row['name'];
}
Expected result:
----------------
I expect to see all 5 names of the rows instead of the last 4.
Actual result:
--------------
Only shows the very last 4 rows which have a level of 3.
--
Edit bug report at http://bugs.php.net/?id=26234&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26234&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26234&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26234&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26234&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26234&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=26234&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26234&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26234&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26234&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26234&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26234&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26234&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26234&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26234&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26234&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26234&r=float