NizarETH
NizarETH

Reputation: 1009

SQLite not working in Symfony2

I had a web application running fine in MySQL, but when I used SQLite I execute all commands, but the problem is tables of database always empty.

So, when sql request gives me this error :

TableNotFoundException in AbstractSQLiteDriver.php line 58: An exception occurred while executing 'INSERT INTO project (Title_Project) VALUES (?)':

SQLSTATE[HY000]: General error: 1 no such table: project

But when I cheek my databse in phpStorm I found the table : enter image description here

this is data in the table

Upvotes: 1

Views: 358

Answers (2)

NizarETH
NizarETH

Reputation: 1009

I found that the created data base in the root folder, copy and past under web folder did the trick, thank's guys.

Upvotes: 0

Denis Alimov
Denis Alimov

Reputation: 2901

check that you have following in config.yml

# Doctrine Configuration
doctrine:
    dbal:
        driver:   pdo_sqlite
        path:     "%database_path%"

in parameters.yml define database_path something like

parameters:
    database_path: "%kernel.root_dir%/db/database.db3"

Upvotes: 2

Related Questions