#29601 [Opn]: sqlite_query() return resource handles for non-row returning sql
| From: | iliaa@php.net | Date: | Wed, 11 Aug 2004 22:08:38 +0000 |
| Subject: | #29601 [Opn]: sqlite_query() return resource handles for non-row returning sql | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969363051@lists.php.net to get a copy of this message | ||
ID: 29601
Updated by: iliaa@php.net
Reported By: Jared dot Williams1 at ntlworld dot com
Status: Open
-Bug Type: SQLite related
+Bug Type: Documentation problem
Operating System: Windows 2000/IIS
PHP Version: 5CVS-2004-08-10 (dev)
New Comment:
Documentation problem.
Previous Comments:
------------------------------------------------------------------------
[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