Error: file is encrypted or is not a database

后端 未结 7 1044
栀梦
栀梦 2020-11-30 08:39

I used PHP to create a database with a table. I did it in the following way:



        
7条回答
  •  忘掉有多难
    2020-11-30 08:54

    The question is two years old but now it can be solved this way:

    class MyDB extends SQLite3
    {
        function __construct()
        {
                $dbFile = __DIR__ . '/../../../adminer/Dictionary.sqlite';
                $this->open($dbFile);
        }
    }
    
    $db = new MyDB();
    $db->exec('CREATE TABLE students (names VARCHAR(80))');
    echo "done";
    

    Source: http://php.net/manual/en/sqlite3.open.php

提交回复
热议问题