title: how do I replace MS Access with SQLite in PHP
body: <p>I am porting a site running PHP with an MS Access DB on a windows machine to a Mac with an SQLite DB.  </p>
  
  <p>the original PHP script uses the following code to connect to the database:</p>
  
  <pre><code>$db = 'S:\~myhome\mydata.mdb';
  $conn = new COM('ADODB.Connection');
  $conn-&gt;Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db");
  </code></pre>
  
  <p>What would be the SQLite equivalent? </p>
  
  <p>Edit: 
  I tried </p>
  
  <pre><code>$db = 'sqlite:'.__DIR__.'/mydata.sqlite'; 
  $conn  = new PDO($db) or die("cannot open the database"); 
  </code></pre>
  
  <p>but it didn't work</p>