|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-06-15 21:35 UTC] gsx1022 at gmail dot com
Description: ------------ A MySQL query that should return 5 records returns an infinite number of records. It returns the 5 five records correctly, but then it returns them again, and again, and again... Other SELECT statements are fine, this is the only problematic one. Also, this query works from the MySQL console just fine. At first I thought it is an issue with Zend Framework but it turned out it is probably not. See this url for (much) more info (also detailed information to reproduce): http://framework.zend.com/issues/browse/ZF-9982 Test script: --------------- $c = mysql_connect('host', 'user', 'pass'); mysql_select_db('db', $c); $raw = mysql_query('SELECT `name`, `level`, `parent` FROM `allresources_view` ORDER BY `level` ASC'); while ($r = mysql_fetch_assoc($raw)) { var_dump($r); echo '<br /><br />'; } mysql_close($c); Expected result: ---------------- 5 records should have been returned from the database. Actual result: -------------- An infinite number of records are returned from the database. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 11:00:01 2025 UTC |
As reference, here the output I get: array(3) { ["name"]=> string(4) "root" ["level"]=> string(1) "0" ["parent"]=> NULL } <br /><br />array(3) { ["name"]=> string(5) "error" ["level"]=> string(1) "1" ["parent"]=> string(4) "root" } <br /><br />array(3) { ["name"]=> string(11) "index_index" ["level"]=> string(1) "1" ["parent"]=> string(4) "root" } <br /><br />array(3) { ["name"]=> string(11) "error_error" ["level"]=> string(1) "2" ["parent"]=> string(5) "error" } <br /><br />array(3) { ["name"]=> string(12) "error_denied" ["level"]=> string(1) "2" ["parent"]=> string(5) "error" } <br /><br />