D:/wamp/www/umer.db
Warning: sqlite_query() [function.sqlite-query]: no such table: config in
D:\wamp\www\sqllite\index.php on line 15
Error in query: SQL logic error or missing database
在PHP中加载数据库时发现此错误。我的源代码是这样的:
<?php
$db = $_SERVER['DOCUMENT_ROOT']."umer.db";
echo $db;
$handle = sqlite_open($db) or
die("Could not open database".sqlite_error_string(sqlite_last_error($handle)));
$query = ("SELECT * FROM config");
$result = sqlite_query($handle,$query) or
die("Error in query: ".sqlite_error_string(sqlite_last_error($handle)));
if (sqlite_num_rows($result) > 0) {
echo "<table cellpadding=10 border=1>";
while($row = sqlite_fetch_array($result)) {
echo "<tr>";
echo "<td>".$row[0]."</td>";
echo "<td>".$row[1]."</td>";
echo "<td>".$row[2]."</td>";
echo "</tr>";
}
echo "</table>";
}
sqlite_close($handle);
?>
答案 0 :(得分:0)
好吧,看起来就像你没有config
表一样:
D:/wamp/www/umer.db Warning: sqlite_query() [function.sqlite-query]:
no such table: config in <<<<< SEE HERE!
D:\wamp\www\sqllite\index.php on line 15
Error in query: SQL logic error or missing database
你确定该表存在吗?
由于sqlite_query()
电话发生第一次错误,似乎正好打开数据库。