title: Insert record into MYSQL database with PHP
body: <p>Hopefully a simple fix but has been stumping me all weekend.</p>
  
  <p>I have a simple script to connect to my MYSQL databse, then using fields from an HTML form enter a new record into the database.</p>
  
  <p>The script is working just fine, but I have not defined the database columns in the script, simply used insert into and then referenced the VALUES as the HTLM form fields.</p>
  
  <p>WORKING</p>
  
  <pre><code>mysql_select_db("golfingdb", $con);
  
  mysql_query("INSERT INTO Test1 
  VALUES
  ('$_POST[firstname]','$_POST[lastname]','$_POST[email]')");
  
  mysql_close($con);
  </code></pre>
  
  <p>NOT WORKING</p>
  
  <pre><code>mysql_select_db("golfingdb", $con);
  
  mysql_query("INSERT INTO 'Test1' (First Name, Surname, Email) 
  VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[email]')");
  
  mysql_close($con);
  </code></pre>
  
  <p>However when I reference the database field names in the code then it fails to make a new record. </p>
  
  <p>I have triple checked the spelling (including capitals) of the field names and it doesn't throw up any syntax errors.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Cheers</p>
  
  <p>Paddy</p>