#36714 [Opn]: wrong squlite_query example
| From: | mazzanet@php.net | Date: | Mon, 13 Mar 2006 10:31:51 +0000 |
| Subject: | #36714 [Opn]: wrong squlite_query example | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969372365@lists.php.net to get a copy of this message | ||
ID: 36714
Updated by: mazzanet@php.net
Reported By: tobias dot nix at gmail dot com
Status: Open
Bug Type: Documentation problem
Operating System: doesnt matter
PHP Version: Irrelevant
New Comment:
Can you provide a link to this example?
I can't seen to find it.
Previous Comments:
------------------------------------------------------------------------
[2006-03-13 11:26:00] tobias dot nix at gmail dot com
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 this bug report at http://bugs.php.net/?id=36714&edit=1