0
我是PEAR DB和SQLite的新手。PEAR DB使用SQLite給出未知錯誤
我做的http://www.codewalkers.com/c/a/Database-Articles/PEARSQLite-The-Lightweight-Alternative/4/
這裏給出一個示例代碼是我的代碼
<?php
require_once('DB.php');
require_once "DB/sqlite.php";
$dsn = "sqlite:////./mydb.db";
$db = new DB_sqlite();
$connection = $db->connect($dsn);
if ($db->isError($connection)){
die("Could not connect to the database: <br />".$db->errorMessage($connection));
}
else
echo "Connected ";
$query = "SELECT * FROM books NATURAL JOIN authors";
$result = $db->simpleQuery($query);
if ($db->isError($result)){
die("Could not query the database:<br />$query ".$db->errorMessage($result));
}
echo('<table border="1">');
echo '<tr><th>Title</th><th>Author</th><th>Pages</th></tr>';
while ($result_row = $result->fetchRow()) {
echo "<tr><td>";
echo $result_row[1] . '</td><td>';
echo $result_row[4] . '</td><td>';
echo $result_row[2] . '</td></tr>';
}
echo("</table>");
$connection->disconnect();
?>
,並在執行這個我收到以下錯誤...
Connected
Strict Standards: Non-static method DB::isManip() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\DB\common.php on line 2200
Strict Standards: Non-static method DB::errorMessage() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\DB.php on line 965
Strict Standards: Non-static method DB::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\DB.php on line 688
Strict Standards: Non-static method DB::errorMessage() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\DB\common.php on line 1963
Warning: Illegal offset type in C:\xampp\php\PEAR\DB\common.php on line 1963
Strict Standards: Non-static method DB::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\DB.php on line 688
Could not query the database:
SELECT * FROM books NATURAL JOIN authors unknown error
可以請你幫助確定這個例子有什麼問題。
謝謝