Doc #54704 [Opn->Fbk]: mysql_num_rows() does work with mysql_unbuffered_query()
| From: | uw@php.net | Date: | Fri, 02 Sep 2011 13:34:38 +0000 |
| Subject: | Doc #54704 [Opn->Fbk]: mysql_num_rows() does work with mysql_unbuffered_query() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7113@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54704&edit=1
ID: 54704
Updated by: uw@php.net
Reported by: juangiordana at gmail dot com
Summary: mysql_num_rows() does work with
mysql_unbuffered_query()
-Status: Open
+Status: Feedback
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
I am not sure what you are saying here. Are you saying it is a bug in ext/mysql ? It is filed as a
documentation problem but the documentation is correct here.
I cannot reproduce any issues with mysql_num_rows() and mysql_unbuffered_query(). Please, provide a
full example including table structure, table data loading and information on how you compiled PHP
(with mysqlnd or libmysql support, if libmysql, which version).
Previous Comments:
------------------------------------------------------------------------
[2011-05-11 00:38:04] juangiordana at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=54704&edit=1