Doc #62764 [NEW]: documented return value incorrect
| From: | doug dot pe at gmail dot com | Date: | Tue, 07 Aug 2012 00:28:51 +0000 |
| Subject: | Doc #62764 [NEW]: documented return value incorrect | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-8705@lists.php.net to get a copy of this message | ||
From: doug dot pe at gmail dot com
Operating system: Ubuntu 10.04
PHP version: 5.3.15
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:documented return value incorrect
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 bug report at https://bugs.php.net/bug.php?id=62764&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62764&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62764&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62764&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=62764&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62764&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=62764&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=62764&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=62764&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=62764&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=62764&r=support
Expected behavior: https://bugs.php.net/fix.php?id=62764&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=62764&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=62764&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=62764&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62764&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62764&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=62764&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=62764&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=62764&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=62764&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=62764&r=mysqlcfg