#31105 [NEW]: sqlite_single_query with "or die" does die when the return value is 0

From: Date: Wed, 15 Dec 2004 23:41:35 +0000
Subject: #31105 [NEW]: sqlite_single_query with "or die" does die when the return value is 0
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-70291@lists.php.net to get a copy of this message
From: dengode at gmail dot com Operating system: Linux PHP version: 4.3.9 PHP Bug Type: SQLite related Bug description: sqlite_single_query with "or die" does die when the return value is 0 Description: ------------ When using sqlite_single_query and the return value from the query is 0 (zero) it's handled as if the query failed. The code will not output 0, but instead die with the following message: "not an error" The value of $result is set to 0, which is expected. Reproduce code: --------------- <?php $db = sqlite_open("test.db"); sqlite_query($db, "CREATE TABLE Test ( number NUMERIC )"); sqlite_query($db, "INSERT INTO Test (number) VALUES (0)"); $result = @sqlite_single_query($db, "SELECT number FROM Test") or die(sqlite_error_string(sqlite_last_error($db))); echo $result; ?> Expected result: ---------------- A return value of 0 from the database being returned to $result without an exception. -- Edit bug report at http://bugs.php.net/?id=31105&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31105&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31105&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31105&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31105&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31105&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31105&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31105&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31105&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31105&r=support Expected behavior: http://bugs.php.net/fix.php?id=31105&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31105&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31105&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31105&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31105&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31105&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31105&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31105&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31105&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=31105&r=mysqlcfg

« previous php.bugs (#70291) next »