Error: file is encrypted or is not a database

后端 未结 7 1026
栀梦
栀梦 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:58

    This is a version mismatch issue.

    To open a database using PHP5 and SQLite we need to use a PDO and not the sqlite_open() function. An example of how to open or create a database:

    try 
    {
        /*** connect to SQLite database ***/
    
        $dbh = new PDO("sqlite:VPN0.sqlite");
        echo "Handle has been created ...... 

    "; } catch(PDOException $e) { echo $e->getMessage(); echo "

    Database -- NOT -- loaded successfully .. "; die( "

    Query Closed !!! $error"); } echo "Database loaded successfully ....";

提交回复
热议问题