title: how to get rows from sqlite db?
body: <p>i am using this PHP code for getting rows but it's getting error</p>
  
  <pre><code>$db = new PDO('sqlite:db/logs');
  
  $result = $db-&gt;exec("SELECT * FROM users");
  
  while($row = $result-&gt;fetch(SQLITE_ASSOC))
  {
  
  }
  </code></pre>
  
  <p>I am using sqlite3 and php5 and i want to know that </p>
  
  <ol>
  <li><p>am i connecting with right code to the database i've also used <code>sqlite.open()</code> but it's also getting error?</p></li>
  <li><p>This <code>new PDO('sqlite:db/logs')</code> connect with database but why new is it create new db everytime</p></li>
  <li><p>my main problem is i am getting error where while loop is that</p></li>
  </ol>
  
  <blockquote>
    <p>Call to a member function fetch() on a non-object</p>
  </blockquote>
  
  <p>please help me out this i am newbie in php and sqlite</p>