I used PHP to create a database with a table. I did it in the following way:
        I faced the same problem, use pdo instead of sqlite_open()
this link is very helpful and here is my code snippet, works perfectly, hope it helps
$dir = 'sqlite:YourPath/DBName.db';
$dbh  = new PDO($dir) or die("cannot open the database");
$query =  "SELECT * from dummy_table";
foreach ($dbh->query($query) as $row)
{
    echo $row[0];
}