Doc #77449 [Opn->Csd]: Bug in example PHP Documentation
| From: | p_i at ukr dot net | Date: | Sat, 12 Jan 2019 12:37:05 +0000 |
| Subject: | Doc #77449 [Opn->Csd]: Bug in example PHP Documentation | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-16325@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77449&edit=1
ID: 77449
User updated by: p_i at ukr dot net
Reported by: p_i at ukr dot net
Summary: Bug in example PHP Documentation
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: CentOS 7
PHP Version: 7.2.14
Block user comment: N
Private report: N
New Comment:
mysqli_result::close ( void ) is alias to mysqli_result::free ( void ), sorry.
Previous Comments:
------------------------------------------------------------------------
[2019-01-12 12:32:11] p_i at ukr dot net
Description:
------------
---
From manual page: https://php.net/mysqli.query
---
Please replace $result->free instead $result->close(). The close () method for the
mysql_result class does not exist.
Example #1 mysqli::query() example
Object oriented style
...
...
...
if ($result = $mysqli->query("SELECT * FROM City", MYSQLI_USE_RESULT)) {
/* Note, that we can't execute any functions which interact with the
server until result set was closed. All calls will return an
'out of sync' error */
if (!$mysqli->query("SET @a:='this will not work'")) {
printf("Error: %s\n", $mysqli->error);
}
$result->close();
}
$mysqli->close();
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77449&edit=1