title: Adding a auto increment field to MySQL in PHP
body: <p>I keep getting this error:</p>
  
  <p><strong>INSERT failed: INSERT INTO clientcontact VALUES('Don Jones', 'Walmart', 'need help', 'don@icsbranch.net', '772-991-0122')
  Column count doesn't match value count at row 1</strong></p>
  
  <p>I am trying to pass a NULL field from get_post function, which is an auto-increment ID field.  Just wondering what I need to change so that the user can fill out the form and have the info entered into the database with the inquiryID auto populated.</p>
  
  <pre><code>&lt;?php 
  
  require_once 'login.php';
  $db_server = mysql_connect($db_hostname, $db_username, $db_password);
  
  if (!$db_server) die("Unable to connect to MySQL: " . mysql_error());
  
  mysql_select_db($db_database, $db_server)
  or die("Unable to select database: " . mysql_error());
  
  {
  $name   = get_post('name');
  $company   = get_post('company');
  $description = get_post('description');
  $email     = get_post('email');
  $phone    = get_post('phone');
  $inquiryID = get_post('inquiryID');
  
  
  $query = "INSERT INTO clientcontact VALUES" .
      "('$name', '$company', '$description', '$email', '$phone', NULL)";
  
  if (!mysql_query($query, $db_server))
      echo "INSERT failed: $query&lt;br /&gt;" .
      mysql_error() . "&lt;br /&gt;&lt;br /&gt;";
  }
  
  echo &lt;&lt;&lt;_END
  &lt;form action="index.php" method="post"&gt;&lt;pre&gt;
         Name: &lt;input type="text" name="name" /&gt;
      Company: &lt;input type="text" name="company" /&gt;
      Inquiry Details: &lt;input type="text" name="description" /&gt;
       E-Mail: &lt;input type="text" name="email" /&gt;
     Phone Number: &lt;input type="text" name="phone" /&gt;
       &lt;input type="submit" value="ADD RECORD" /&gt;
  
  &lt;/pre&gt;&lt;/form&gt;
  _END;
  
  mysql_close($db_server);
  
  function get_post($var)
  {
  return mysql_real_escape_string($_POST[$var]);
  }
  ?&gt;
  </code></pre>