title: Inserting data with PDO. I have tried so many ways and failed
body: <p>I have just begun learning PDO.  I have connected to my database and I have a working login happening with the mySql database.  Now I am trying to get three pieces of data from a form and then insert them into the table.  I have been on this for a week and every version I come up with fails.  I get no error messages yet when I check the table it remains empty. </p>
  
  <p>As I have other PDO action working, I'm confident that the problem is in the following piece of code.   The button involved is named 'addGig'.  This is the first time I have used the name of a button...  I'm not confident with this. </p>
  
  <p>I have just edited this post to include my revised code. 
  So many rookie mistakes!</p>
  
  <p>
  
  <pre><code>       $date  = $_POST['date'];
         $venue = $_POST['venue'];
         $time  = $_POST['time'];
  
     if (!empty($date) &amp;&amp; !empty($venue) &amp;&amp; !empty($time)){
  
      try{
          $query = $connect-&gt;prepare("INSERT INTO gigs (date, venue, time) VALUES (:date, :venue, :time)");
          $query-&gt;bindParam(':date' , $date);
          $query-&gt;bindParam(':venue' , $venue);
          $query-&gt;bindParam(':time' , $time);
          $query-&gt;execute(); 
  
         }
  
       catch(PDOException $e)
         {
         handle_sql_errors($query, $e-&gt;getMessage());
         }
    }
  </code></pre>
  
  <p>}</p>
  
  <p>This is my html form</p>
  
  <pre><code>  &lt;form&gt;
    &lt;label&gt;date&lt;/label&gt;&lt;br&gt;&lt;input type="text" name="date"&gt;&lt;br&gt;
    &lt;label&gt;venue&lt;/label&gt;&lt;br&gt;&lt;input type="text" name="venue"&gt;&lt;br&gt;
    &lt;label&gt;time&lt;/label&gt;&lt;br&gt;&lt;input type="text" name="time"&gt;&lt;br&gt;
    &lt;br&gt;
    &lt;button type="submit" value="addGig" name="addGig"&gt;add gig&lt;/button&gt;
    &lt;/form&gt;
  </code></pre>