我想查询一个与PDO SQLite数据库,我似乎无法弄清楚为什么我的查询返回什么......请让我知道我做错了: 这是我的代码:Sqlite与PHP PDO选择查询
<?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](http://nl3.php.net/manual/en/book.pdo.php)。您正在使用[SQLite3扩展名](http://nl3.php.net/manual/en/book.sqlite3.php)。 – 2011-04-28 05:17:08