title: How to delete the rows from Sqlite Database in php
body: <p>I am new to PhP. I am trying to delete some rows from my sqlite database, but I can't figure out what is wrong. My code is as below:</p>
  
  <pre><code>&lt;?php
      $app_name=array("TestApp", "MyDataBase");
      $dir = 'sqlite:/home/ravi/public_html/GcmServer/FavoriteApps.db';
      $dbh= new PDO($dir) or die("cannot open the database");
      for($i=0;$i&lt;sizeof($app_name);$i++) {
          error_log("looop start here...............");
          error_log("FirstAppName ".$app_name[$i]);
          $result=  $dbh-&gt;Query("DELETE FROM favorite_apps WHERE appname = '$app_name[$i]'") or die( error_log("error".mysql_error() ));
          error_log("looop execute here...............");
      }
  ?&gt;
  </code></pre>
  
  <p>And my log file is like this:</p>
  
  <pre><code>[Wed Sep 19 11:16:38 2012] [error] [client 127.0.0.1] looop start    here...............
  [Wed Sep 19 11:16:38 2012] [error] [client 127.0.0.1] FirstAppName TestApp
  [Wed Sep 19 11:16:38 2012] [error] [client 127.0.0.1] error
  </code></pre>
  
  <p>and my localhost show 1,<br />
  thanks.</p>