#36714 [NEW]: wrong squlite_query example

From: Date: Mon, 13 Mar 2006 10:26:01 +0000
Subject: #36714 [NEW]: wrong squlite_query example
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969372362@lists.php.net to get a copy of this message
From: tobias dot nix at gmail dot com Operating system: doesnt matter PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: wrong squlite_query example Description: ------------ The example1 is the following: <?php if ($db = sqlite_open('mysqlitedb', 0666, $sqliteerror)) { sqlite_query('CREATE TABLE foo (bar varchar(10))'); sqlite_query("INSERT INTO foo VALUES ('fnord')"); $result = sqlite_query('select bar from foo'); var_dump(sqlite_fetch_array($result)); } else { die ($sqliteerror); } ?> On sqlite_query is a $db missing: <?php if ($db = sqlite_open('mysqlitedb', 0666, $sqliteerror)) { sqlite_query($db, 'CREATE TABLE foo (bar varchar(10))'); sqlite_query($db, "INSERT INTO foo VALUES ('fnord')"); $result = sqlite_query($db,'select bar from foo'); var_dump(sqlite_fetch_array($result)); } else { die ($sqliteerror); } ?> -- Edit bug report at http://bugs.php.net/?id=36714&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36714&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36714&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36714&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36714&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36714&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36714&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36714&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36714&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36714&r=support Expected behavior: http://bugs.php.net/fix.php?id=36714&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36714&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36714&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36714&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36714&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36714&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36714&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36714&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36714&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36714&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36714&r=mysqlcfg

« previous php.doc (#969372362) next »