dimanche 25 octobre 2015

Got "General error: 1 no such table: player" when table `player` exists

I've create a database with sqlite, and added a table player

$ sudo vendor/bin/doctrine orm:schema-tool:update --dump-sql CREATE TABLE player (id INTEGER NOT NULL, username VARCHAR(50) NOT NULL, PRIMARY KEY(id));


Verified that the table exists

$ sqlite3 database SQLite version 3.8.5 2014-08-15 22:37:57 Enter ".help" for usage hints. sqlite> .tables player sqlite>


But when i DQL to player table

$entityManager = EntityManager::create(); $query = $entityManager->createQuery( "SELECT p FROM Player p where p.username = :username" ); $query->setParameter('username', $_POST['username']); $player = $query->getResult();

I always receive the message

( ! ) Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 no such table: player' in ... /vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php on line 58

Aucun commentaire:

Enregistrer un commentaire