Sqlite with PHP Select Query Sqlite with PHP Select Query sqlite sqlite

Sqlite with PHP Select Query


SQLite3::query returns a result resource object. You need to use the fetchArray method on it to get rows from it:

$query = "select user FROM test";echo "here";$result = $dbname->query($query);while ($row = $result->fetchArray()) {    print $row["user"] . "\n";}


    class MyDB extends SQLite3    {        function __construct($db_name)        {            $this->open($db_name.".db");        }    }$db = new MyDB($user_db);$result = $db->query("your query ");

its working great with me in php...you must be enable SQLite3 module version and SQLite Library in your phpinfo file...