【发布时间】:2011-08-14 09:48:48
【问题描述】:
我正在尝试查询一个 sqlite,但我似乎无法弄清楚为什么我的查询没有返回任何内容...请让我知道我做错了什么: 这是我的代码:
<?php
class MyDB extends SQLite3
{
function __construct()
{
$this->open('zap.db');
}
}
$dbname = new MyDB();
$tablename = "test";
error_reporting (E_ALL ^ E_NOTICE);
$result = "select user FROM test";
echo "here";
$row = $dbname->query($result);
foreach ($dbname->query("$result") as $row) {
print $row["user"] . "\n";
}
?>
【问题讨论】:
-
你没有使用PDO。您正在使用SQLite3 extension。