#29601 [Opn->Csd]: sqlite_query() return resource handles for non-row returning sql
| From: | vrana@php.net | Date: | Mon, 16 Aug 2004 09:13:49 +0000 |
| Subject: | #29601 [Opn->Csd]: sqlite_query() return resource handles for non-row returning sql | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969363214@lists.php.net to get a copy of this message | ||
ID: 29601
Updated by: vrana@php.net
Reported By: Jared dot Williams1 at ntlworld dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Windows 2000/IIS
PHP Version: 5CVS-2004-08-10 (dev)
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.
"This function will return a result handle or false for failure. For
queries that return rows, the result handle can then be used with
functions such as sqlite_fetch_array() and sqlite_seek()."
Previous Comments:
------------------------------------------------------------------------
[2004-08-12 00:08:37] iliaa@php.net
Documentation problem.
------------------------------------------------------------------------
[2004-08-10 16:06:50] Jared dot Williams1 at ntlworld dot com
Description:
------------
It appears sqlite_query() and sqlite_unbuffered_query() differ from the
documentation
From http://uk.php.net/manual/en/function.sqlite-query.php
<quote>
For queries that return rows, this function will return a result handle
which can then be used with functions such as sqlite_fetch_array() and
sqlite_seek().
For other kinds of queries, this function will return a boolean result;
TRUE for success or FALSE for failure.
</quote>
Seems a handle is returned irrespective of the type of query.
Reproduce code:
---------------
<?php
$cnn = sqlite_open('Northwind.db');
if (is_resource($cnn))
{
var_dump(sqlite_unbuffered_query($cnn, 'DELETE FROM Categories WHERE
CategoryID > 100000'));
@sqlite_close($cnn);
}
?>
Expected result:
----------------
bool(true)
Actual result:
--------------
resource(2) of type (sqlite result)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29601&edit=1