Bug->Doc #68248 [Opn->Ver]: Syntax error in example code
| From: | cmb@php.net | Date: | Wed, 09 Sep 2015 12:16:20 +0000 |
| Subject: | Bug->Doc #68248 [Opn->Ver]: Syntax error in example code | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12740@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68248&edit=1
ID: 68248
Updated by: cmb@php.net
Reported by: php at gosoftware dot com dot au
-Summary: I believe that there is an error in the
documentation page
+Summary: Syntax error in example code
-Status: Open
+Status: Verified
-Type: Bug
+Type: Documentation Problem
Package: sqlsrv
PHP Version: 5.4.34
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2014-10-17 07:48:01] php at gosoftware dot com dot au
Description:
------------
---
From manual page: http://www.php.net/function.sqlsrv-num-fields
---
I believe that there is an error in the documentation page - one two many { characters in the
example ...
I think that it should be ....
// Example of sqlsrv_num_fields
$sql = "SELECT * FROM Table_1";
$query = sqlsrv_query($conn, $sql);
if( $query === false) { die( print_r( sqlsrv_errors(), true)); }
$numFields = sqlsrv_num_fields( $query );
while( sqlsrv_fetch( $stmt )) {
for($i = 0; $i < $numFields; $i++) { // Iterate through the fields of each row.
echo sqlsrv_get_field($stmt, $i)." ";
}
echo "<br />";
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68248&edit=1