Doc #54704 [NEW]: mysql_num_rows() does work with mysql_unbuffered_query()

From: Date: Tue, 10 May 2011 22:38:12 +0000
Subject: Doc #54704 [NEW]: mysql_num_rows() does work with mysql_unbuffered_query()
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6382@lists.php.net to get a copy of this message
From: Operating system: PHP version: 5.3.6 Package: Documentation problem Bug Type: Documentation Problem Bug description:mysql_num_rows() does work with mysql_unbuffered_query() Description: ------------ mysql_num_rows() does work with mysql_unbuffered_query() if all the rows in the result have been retrieved. --- From manual page: http://www.php.net/function.mysql-unbuffered-query#Notes --- "you cannot use mysql_num_rows() and mysql_data_seek() on a result set returned from mysql_unbuffered_query()" --- From manual page: http://www.php.net/function.mysql-num-rows#Notes --- "If you use mysql_unbuffered_query(), mysql_num_rows() will not return the correct value until all the rows in the result set have been retrieved." Test script: --------------- <?php $sql = 'SELECT id FROM table'; $result = mysql_query($sql); echo mysql_num_rows($result) . " results from buffered query.\n"; mysql_free_result($result); $sql = 'SELECT id FROM table'; $result = mysql_unbuffered_query($sql); echo mysql_num_rows($result) . " results from unfinished unbuffered query.\n"; while ($row = mysql_fetch_assoc($result)) { // } echo mysql_num_rows($result) . " results from finished unbuffered query.\n"; ?> -- Edit bug report at http://bugs.php.net/bug.php?id=54704&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54704&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54704&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54704&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54704&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54704&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54704&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54704&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54704&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54704&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54704&r=support Expected behavior: http://bugs.php.net/fix.php?id=54704&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54704&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54704&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54704&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54704&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54704&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54704&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54704&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54704&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54704&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54704&r=mysqlcfg

« previous php.doc.bugs (#6382) next »