note 51994 added to function.sqlite-array-query
| From: | kendlj at NOSPAM dot web dot de | Date: | Mon, 18 Apr 2005 11:22:03 +0000 |
| Subject: | note 51994 added to function.sqlite-array-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88153@lists.php.net to get a copy of this message | ||
Do not use this code, whenever you may get no result:
<?
$return_data=@sqlite_array_query($query,$databaseHandle);
if(!$return_data)
{
//Errorhandling code
die( sqlite_error_string( sqlite_last_error($this->databaseHandle) ) );
}
?>
It will execute the Errorhandling code although there is no error, cause if there is nothing found,
sqlite_array_query returns an empty array, which is interpreted as 'false' here.
You will get an Message like:
'not an error'
Instead use:
<?
$return_data=@sqlite_array_query($query,$databaseHandle);
if($return_data===false)
{
//Errorhandling code
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.sqlite-array-query.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51994
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51994&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51994&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51994&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51994&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51994&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51994&report=yes
Search -- http://master.php.net/manage/user-notes.php