title: mySQL not saving data?
body: <p>i have a PHP contact form that submits data, and an email...:</p>
  
  <pre><code>&lt;?php 
  $dbh=mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
  mysql_select_db ("guest"); 
  
  if (isset($_POST['submit'])) { 
  
  if (!$_POST['name'] | !$_POST['email']) 
  {
  echo"&lt;div class='error'&gt;Error&lt;br /&gt;Please provide your Name and Email Address so we may properly contact you.&lt;/div&gt;";
  }
  else
  {
  $age = $_POST['age']; 
  $name = $_POST['name'];
  $gender = $_POST['gender'];
  $email = $_POST['email'];
  $phone = $_POST['phone'];
  $comments = $_POST['comments'];
  
  $query = "INSERT INTO contact_us (age,name,gender,email,phone,comments)
  VALUES ('$age','$name','$gender','$email','$phone','$comments')";
  
  mysql_query($query);
  
  mysql_close();
  
  $yoursite = "Mysite ";
  $youremail = $email;
  
  $subject = "Website Guest Contact Us Form";
  $message = "$name would like you to contact them 
                              Contact PH:  $phone
  Email:  $email
  Age: $age
  Gender: $gender
  Comments:  $comments";
  
  $email2 = "my@email.com";
  
  mail($email2, $subject, $message, "From: $email");
  
  echo"&lt;div class='thankyou'&gt;Thank you for contacting us,&lt;br /&gt; we will respond as soon as we can.&lt;/div&gt;";
  
  }
  }
  ?&gt;
  </code></pre>
  
  <p>The email is coming through fine, but the data is not storing the dbase... am i missing something?
  Its the same script as i use on another contact us page, only difference is instead of parsing the data on teh same page, i now send this data to a "thankyou.php" page... i tried changing $_POST to $_GET but that killed the page... what am i doing wrong?</p>