title: Why doesn't this PDO prepared statement work?
body: <p>For the life of me I cannot seem to get this simple insert query to work:</p>
  
  <pre><code>try {
  
  // Connect to database
  $dbh = new PDO("mysql:host=$host;dbname=$db", $user, $pass);
  
  // Create an array of all data to be inserted
  $data = array(':id'      =&gt; 'null',
                ':name'       =&gt; $name,
                ':location'   =&gt; $loc,
                ':latitude'   =&gt; $lat,
                ':longitude'  =&gt; $lon,
                ':website'    =&gt; $web,
                ':bandcamp'   =&gt; $bandcamp,
                ':facebook'   =&gt; $facebook,
                ':bio'        =&gt; $bio,
                ':image'      =&gt; $image,
                ':updated'    =&gt; 'null');
  
  // Create sql statement
  $sql = 'INSERT INTO artists VALUES (:id, :name, :location, :latitude, :longitude, :website, :bandcamp, :facebook, :bio, :image, :updated)';
  
  // Run query
  $query = $dbh-&gt;prepare($sql);
  $query-&gt;execute($data);
  
  // Disconnect from database
  $dbh = null;
  
  }
  
  catch(PDOException $e) {
  echo $e-&gt;getMessage();
  }
  </code></pre>
  
  <p>The data is not being inserted into the table and I am not getting any error messages.  Am I missing something here?</p>