Doctrine DBAL and sqlite problems -


i trying connect sqlite database file doctrine dbal.

<?php use doctrine\dbal\drivermanager; require_once 'bootstrap.php'; $connectionparams = [     'url' => 'sqlite:///crawls.db', ]; $conn = drivermanager::getconnection($connectionparams); 

but when try execute sql code says table not exist (of course checked manually , there).

$conn->exec('select * crawl_item'); 

outputs

php fatal error:  uncaught exception 'pdoexception' message 'sqlstate[hy000]: general error: 1 no such table: crawl_item' in /home/px/documents/phpcrawler/vendor/doctrine/dbal/lib/doctrine/dbal/driver/pdoconnection.php:57 stack trace:... 

may output can helpful

 var_dump($conn->connect());  var_dump($conn->getdatabase());   bool(true)  null 

if @ abstractsqlitedriver::_constructpdodsn() method see parameter 'path':

$connectionparams = [     [         'driver' => 'pdo_sqlite',         'path' => '../products.db'     ] );  $conn = drivermanager::getconnection($connectionparams); 

greetings, thomas


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -