我想查詢一個與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