title: Connect to SQLite using PHP - Cannot Connect
body: <p>I'm trying to use PHP to connect to SQLite. I created a database by importing a CSV file into the tables for three tables. However, I'm unable to connect using the following code:</p>
  
  <pre><code>$dbhandle = sqlite_open('db/pokedex.db', 0666, $error);
  if(!$dbhandle) die ($error);
  </code></pre>
  
  <p>This returns the following error:</p>
  
  <p><code>Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database in /pokedex/configpokedexdb-sqlite.php on line 12
  file is encrypted or is not a database</code></p>
  
  <p>Googling told me I might have a version mismatch. Despite finding some SQLite3 mentions in my phpinfo(), I decided it might still be a problem so I tried the following suggested code:</p>
  
  <pre><code>try
  {
      //connect to SQLite database
  
      $dbhandle = new PDO("sqlite:db/pokedex.db"); //sqlite:VPN0.sqlite
     // echo "Handle has been created ...... &lt;br&gt;&lt;br&gt;";
  
  }
  catch(PDOException $e)
  {
      echo $e-&gt;getMessage();
      echo "&lt;br&gt;&lt;br&gt;Database -- NOT -- loaded successfully .. ";
      die( "&lt;br&gt;&lt;br&gt;Query Closed !!! $error");
  }
  </code></pre>
  
  <p>After which I received the following error:</p>
  
  <p><code>Warning: sqlite_exec() expects parameter 1 to be resource, object given in /home/rawdco81/public_html/pokedex/index-sqlite.php on line 53</code></p>
  
  <p>Before this, I tried running <code>new PDO("sqlite:VPN0.sqlite");</code> which was what the site provided, but that was obviously wrong because it didn't point to my .db file at all. You'll see this piece of code in the comments beside the function call.</p>
  
  <p>I'm having a hard time just connecting to the database...What is the proper way to do this?</p>
  
  <p>Also, I'm running PHP Version 5.2.13.</p>
  
  <p>EDITED: I pasted the wrong error message in the wrong place.</p>