title: catch up SQLite error "database is locked"
body: <p>i am opening an SQLiteDB with following statement in PHP what is working well.</p>
  
  <pre><code>$db2 = new SQLite3("/home/pi/ion.sqb", SQLITE3_OPEN_READONLY);
  $resu2 = $db2-&gt;query("select * from test where name = 'Hans'");
  </code></pre>
  
  <p>however from time to time i am running into following error message :: SQLite is locked and the PHP-script kills itself with following fatal message:</p>
  
  <pre><code>PHP Warning:  SQLite3::query(): Unable to execute statement: database is locked in /home/pi/ion.sqb on line 559
  PHP Fatal error:  Uncaught Error: Call to a member function fetchArray() on boolean in /home/pi/dbc.php:560
  Stack trace:
  #0 {main}
    thrown in /home/pi/dbc.php on line 560
  </code></pre>
  
  <p>I tried to check if the DB is locked and skip the select ... however without success:</p>
  
  <pre><code>$db2 = new SQLite3("/home/pi/ion.sqb", SQLITE3_OPEN_READONLY);
  $resu2 = $db2-&gt;query("select * from test where name = 'Hans'");
  if (!$db2) {
      echo "DB DB-locked";
      }
  else{ 
      $resu2 = $db2-&gt;query("select * from test where name = 'Hans'");
      while ($dsatz2 = $resu2-&gt;fetchArray(SQLITE3_ASSOC))
    ...
  </code></pre>
  
  <p>the issue that you can run into a logged SQLite DB is known .. 
  also for a select, when any other handle is in write-mode.</p>
  
  <p>how can i circumstanced that my script runs into that fatal error and ends itself?</p>
  
  <pre><code>PHP Fatal error:  Uncaught Error: Call to a member function fetchArray() on boolean in /home/pi/dbc.php:560
  Stack trace:
  #0 {main}
    thrown in /home/pi/dbc.php on line 560
  </code></pre>