mevdschee / php-crud-api

Single file PHP script that adds a REST API to a SQL database
MIT License
3.59k stars 1.01k forks source link

SQLSTATE[HY000]: General error: 1 near \"(\": syntax error [New Versions] #1040

Open drveresh opened 2 months ago

drveresh commented 2 months ago

I am facing the below error despite trying multiple versions of PHP (7.2, 7.3, 8.1) and ensuring the required Sqlite versions(PDO Driver 3.7.17), on shared cPanel servers.

{
"code": 9999,
"message": "SQLSTATE[HY000]: General error: 1 near \"(\": syntax error"
}

Below is its config:

$config = new Config([
        'driver' => 'sqlite',
        'address' => './logs.db',
        // 'address' => 'localhost',
        // 'port' => '3306',
        //'username' => '',
        //'password' => '',
        'database' => 'php-crud-api',
        // 'debug' => false
    ]);

Please help me out.

mevdschee commented 2 months ago

Hi Veeresh, SQLite 3.22 or higher is required, see tests. What version are you running? Kind regards, Maurits