title: how to get last inserted Id of a Sqlite database using Zend_Db
body: <p>I'm trying to fetch the last inserted row Id of a Sqlite DB in my PHP application. I'm using Zend Framework's PDO Sqlite adapter for database handling. the lastInsertId() method is supposed to give me the results, but it wouldn't. In PDO documentation in php.net I read that the lastInsertId() might not work the same on all databases. but wouldn't it work on sqlite at all?
  I tried overwriting the lastInsertId() method of the adapter by this:</p>
  
  <pre><code>// Zend_Db_Adapter_Pdo_Sqlite
  public function lastInsertId() {
      $result = $this-&gt;_connection-&gt;query('SELECT last_insert_rowid()')-&gt;fetch();
      return $result[0];
  }
  </code></pre>
  
  <p>but it does not work either. just returns 0 everytime I call it. is there any special clean way to find the last inserted Id?</p>