|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-08 11:18 UTC] guillaume dot david at noos dot fr
[2007-02-08 11:41 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Feb 05 05:00:02 2026 UTC |
Description: ------------ I thinks i have found a bug in the mysql_fetch_row, mysql_fetch_array and mysql_fetch_assoc functions. When I select twice the same field with 2 different tags, mysql_fetch_* always return the same line. Reproduce code: --------------- <?php include "conf.php"; $sql = "SELECT DISTINCT page as CHAMP, page as VALEUR FROM logs WHERE 1 ORDER BY CHAMP ASC"; $q = mysql_query($sql) or die (mysql_error()); while($foo = mysql_fetch_array($q)) { print_r($foo); echo '<br>'; } ?> Expected result: ---------------- Array ( [0] => accueil.php [CHAMP] => accueil.php [1] => accueil.php [VALEUR] => accueil.php ) Array ( [0] => logs.php [CHAMP] => logs.php [1] => logs.php [VALEUR] => logs.php ) Actual result: -------------- Array ( [0] => logs.php [CHAMP] => logs.php [1] => logs.php [VALEUR] => logs.php ) Array ( [0] => logs.php [CHAMP] => logs.php [1] => logs.php [VALEUR] => logs.php )