-1

Possible Duplicate:
SQLite database path not working

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

I found this error when loaded data base in PHP. My source code is this:

<?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);
?>
1
  • Did you try $_SERVER['DOCUMENT_ROOT'] . '/' . 'umer.db'? Commented Jun 7, 2011 at 8:38

1 Answer 1

0

Well, it looks like you don't have a config table:

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

Are you sure that table exists?

It seems to be opening the database okay since the first error occurs on the sqlite_query() call.

Sign up to request clarification or add additional context in comments.

1 Comment

yes it sur that the table is existing but the error msg is again it shows....what should to do for testing it ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.