php - PDO with sqlite wont insert anything -


i have problem pdo (i new this). code not able insert table. i've tried every possible way came insert variables code (array, straight statement, , without inserting id null, etc.).

$db = new pdo('sqlite:hpoi.sqlite'); $qry = $db->prepare('insert tbl_hpoifinds (user, hpoiid) values (?, ?)'); $qry->execute(array(null, $invoker, $id)); 

after this, table stays empty... when try use:

$db->setattribute(pdo::attr_errmode, pdo::errmode_exception); 

i error:

fatal error: uncaught exception 'pdoexception' message 'sqlstate[hy000]: general error: 10 disk i/o error' in /disk2/www/milerking.cz/dixi/projects/hpoi_plugin/hpoi.lib.php:39 stack trace: #0 /disk2/www/milerking.cz/dixi/projects/hpoi_plugin/hpoi.lib.php(39): pdostatement->execute(array) #1 /disk2/www/milerking.cz/dixi/projects/hpoi_plugin/hpoi.lib.php(23): hpoiright('dixxcz', 'riverofslime') #2 /disk2/www/milerking.cz/dixi/projects/hpoi_plugin/hpoi.lib.php(11): hpoicheck('dixxcz', 'riverofslime') #3 /disk2/www/milerking.cz/dixi/projects/hpoi_plugin/hpoi.lib.php(65): hpoi('dixxcz', 'riverofslime') #4 {main} thrown in /disk2/www/milerking.cz/dixi/projects/hpoi_plugin/hpoi.lib.php on line 39  

the full code can found here

you prepared 2 placeholders, passed 3 parameters execute() numbers must match:

$qry = $db->prepare('insert tbl_hpoifinds (user, hpoiid) values (?, ?)'); $qry->execute(array($invoker, $id)); 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -