Doc #62764 [Opn->Csd]: documented return value incorrect
Edit report at https://bugs.php.net/bug.php?id=62764&edit=1
ID: 62764
Updated by: aharvey@php.net
Reported by: doug dot pe at gmail dot com
Summary: documented return value incorrect
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Ubuntu 10.04
PHP Version: 5.3.15
-Assigned To:
+Assigned To: aharvey
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2012-09-08 16:56:47] frozenfire@php.net
https://github.com/php/php-src/blob/master/ext/mssql/php_mssql.c#L1313
mssql_fetch_batch returns the number of rows in the fetched batch. Docs should be
updated to reflect that.
------------------------------------------------------------------------
[2012-08-07 00:28:51] doug dot pe at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.mssql-fetch-batch
---
(Actually, my version is listed as 5.3.2, but that's not one of the options in your drop-down.)
The documentation states that the return value is the batch number.
The comment in the example states that the return value is the number of records remaining before
the fetch.
These can't both be correct.
Test script:
---------------
<?
$connect = mssql_connect("servername", "username", "password");
// or die ("could not connect to the server");
mssql_select_db("myDatabase")
or die ("could not select a database");
$SQL = "select * from myTable"; // mytable contains 4700 rows
$result = mssql_query($SQL, $connect, 1000)
or die ("An error occurred: " . mssql_get_last_message());
$count = mssql_num_rows($result);
do {
print $count . "<br />\n";
// }
} while ($count = mssql_fetch_batch($result));
mssql_close($connect);
?>
Expected result:
----------------
If the return value is the batch number:
1000
1
2
3
4
If the return value is the number of rows remaining before the fetch:
1000
3700
2700
1700
700
Actual result:
--------------
1000
1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62764&edit=1
Thread (3 messages)