note 33503 rejected from function.mysql-fetch-array by torben

From: Date: Sat, 28 Jun 2003 02:30:23 +0000
Subject: note 33503 rejected from function.mysql-fetch-array by torben
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-51125@lists.php.net to get a copy of this message
Note Submitter: mr_x_nop@hotmail.com ---- Having problems with mysql_fetch_array(), I think. The problem is with the code bellow, I allways miss out the first record. If I for example finds 2 records ($num_rows=2), only one gets displayed. What am I doing wrong here? Can someone fix my code? $sql = "SELECT * FROM something"; $result = mysql_db_query("mydb","$sql"); $rows = mysql_fetch_array($result); $num_rows = mysql_num_rows($result); while($rows=mysql_fetch_array($result)) { ?> A row: <?=$rows["myfield"]?><br><? }

« previous php.notes (#51125) next »