php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #29601 sqlite_query() return resource handles for non-row returning sql
Submitted: 2004-08-10 16:06 UTC Modified: 2004-08-16 11:13 UTC
From: Jared dot Williams1 at ntlworld dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5CVS-2004-08-10 (dev) OS: Windows 2000/IIS
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Jared dot Williams1 at ntlworld dot com
New email:
PHP Version: OS:

 

 [2004-08-10 16:06 UTC] 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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-12 00:08 UTC] iliaa@php.net
Documentation problem. 
 [2004-08-16 11:13 UTC] vrana@php.net
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()."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 17 10:01:28 2024 UTC