1

I am trying to insert into my database, however it is not working. This is the error I get:

Error Number: HY000/5
database is locked

This is my code:

$this->load->database();
$data = array('x' => '1','alfa' => '1', 'afstand' => '1', 'laatst' => '1');

if($this->db->insert('configuratie', $data))                
{
    echo "success";
}
else{
    echo "error";
}

I am using a SQLITE database. What's going wrong or what could I try?

Simon H
  • 374
  • 2
  • 14
  • Please see here http://stackoverflow.com/questions/6000336/how-to-debug-lock-wait-timeout-exceeded and here http://stackoverflow.com/questions/2766785/fixing-lock-wait-timeout-exceeded-try-restarting-transaction-for-a-stuck-my 90% problem related with timeout. – yAnTar Apr 19 '15 at 17:17
  • So how do I fix it in php? – Simon H Apr 19 '15 at 17:37
  • 1
    I think problem is with access to file (maybe file is readonly) – yAnTar Apr 19 '15 at 19:21

1 Answers1

1

I deleted my database file and restored it from a backup and then it worked again.

Simon H
  • 374
  • 2
  • 14