title: SQLite3 Query to list all tables in database only shows one table
body: <p>I need to be able to read all the tables in an SQLite database without knowing what the tables will be called. I'm working on the following example.db</p>
  
  <p><em>chinhook.db</em></p>
  
  <p><strong>Tables</strong>    </p>
  
  <p>Album,
  Artist,
  Customer,
  Employee,
  Genre,
  Invoice,
  InvoiceLine,
  MediaType,
  Playlist,
  PlaylistTrack,
  Track.</p>
  
  <p>Currently, I'm using the following...</p>
  
  <pre><code>&lt;?php
      $db = new SQLite3('db/chinhook.db');
      $tablesquery = $db-&gt;query("SELECT name FROM sqlite_master WHERE type='table';");
      $tables = $tablesquery-&gt;fetchArray(SQLITE3_ASSOC);
  
      foreach($tables as $name){
         echo $name.'&lt;br /&gt;';
      }
  ?&gt;
  </code></pre>
  
  <p>I can only ever seem to get the name of the first table. I can call data from the other tables no problem, but the sqlite_master table only contains one of the table names. Others online seem to report this method as successful. Any Ideas?</p>
  
  <p>Thanks in advance.</p>