这是我的源代码,我在PHP源代码中使用了sqlite数据库.当我运行脚本时,它给了我这个错误
原文链接:https://www.f2er.com/sqlite/197879.htmlWarning: sqlite_query() [function.sqlite-query]: no such table: books in D:\wamp\www\sqllite\index.PHP on line 13 Error in query: sql logic error or missing database
<?PHP $db = $_SERVER['DOCUMENT_ROOT']."umer.db"; $handle = sqlite_open($db) or die("Could not open database".sqlite_error_string(sqlite_last_error($handle))); $query = "SELECT * FROM books"; $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); ?>