php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #62764 documented return value incorrect
Submitted: 2012-08-07 00:28 UTC Modified: 2012-09-10 02:04 UTC
From: doug dot pe at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.15 OS: Ubuntu 10.04
Private report: No CVE-ID: None
 [2012-08-07 00:28 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-08 16:56 UTC] 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-09-10 02:04 UTC] aharvey@php.net
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.


 [2012-09-10 02:04 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2012-09-10 02:05 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=327573
Log: Fix doc bug #62764 (documented return value incorrect).
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 13:00:01 2026 UTC