|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35248 sqlite_query() doesnt set error_msg
Submitted: 2005-11-16 23:28 UTC Modified: 2005-11-17 15:40 UTC
From: jwellis at carlalbert dot edu Assigned: wez (profile)
Status: Closed Package: SQLite related
PHP Version: 5.1.0RC5 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jwellis at carlalbert dot edu
New email:
PHP Version: OS:


 [2005-11-16 23:28 UTC] jwellis at carlalbert dot edu
When setting the result of sqlite_query to a result set, if there is an error, error_msg is not set.  Example:

$result = $db->query("asdfesdfa", SQLITE_NUM, $db_error);

i would like to note, however, that if i dont set the results into a result set, it works just fine.  Example:

$db->query("asdfesdfa", SQLITE_NUM, $db_error);

Reproduce code:
$db = new SQLiteDatabase("sqlite_db1");
$result = $db->query("asdfesdfa", SQLITE_NUM, $db_error);
print">> $db_error<br>\n";
$db->query("asdfesdfa", SQLITE_NUM, $db_error);
print">> $db_error<br>\n";

Expected result:
>> near "asdfesdfa": syntax error
>> near "asdfesdfa": syntax error

Actual result:
>> near "asdfesdfa": syntax error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-16 23:46 UTC]
As far as I can tell, this is intentional. Perhaps Wez can share a light on the reasoning behind it though. (so that our brave documenters can do their work :)
 [2005-11-17 15:40 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 14:01:33 2024 UTC