title: Failing to create mySQL table
body: <p>I'm trying to create a table if it does not already exist in my database. For this I'm running this test which is working as intended:</p>
  
  <pre><code>$conn = mysql_connect("localhost", "twa222", "twa222bg");
  mysql_select_db("airline222", $conn) or die ("Database not found " . mysql_error() );
  $val = mysql_query("SELECT 1 from '$FLIGHTID'");
  </code></pre>
  
  <p>However my problem comes when I try to create the table itself, which is giving me the following error: 
  Problem with query: <code>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''passenger' SMALLINT NOT NULL, 'booking' CHAR(6), 'seat' VARCHAR(3))' at line 2</code></p>
  
  <p>This is the code that is attempting to generate the table</p>
  
  <pre><code>if(!$val)
  {
      $sql = "CREATE TABLE ".$FLIGHTID." (
      passenger SMALLINT NOT NULL PRIMARY KEY,
      booking CHAR(6), seat VARCHAR(3) )";
      $rs = mysql_query($sql) or die ("Problem with query" . mysql_error());
  }
  mysql_close($conn);
  </code></pre>
  
  <p>I originally thought it was the ".$FLIGHTID." that was causing the problem but when I changed that to simply be ABC I still got the same error. </p>
  
  <p>Can anyone see where I am going wrong?</p>
  
  <p><strong>EDIT:</strong>
  My SQL output when using ABC is:</p>
  
  <p>CREATE TABLE ABC ( passenger SMALLINT NOT NULL PRIMARY KEY, booking CHAR(6), seat VARCHAR(3) )</p>
  
  <p>Without using ABC it is:</p>
  
  <p>CREATE TABLE ( passenger SMALLINT NOT NULL PRIMARY KEY, booking CHAR(6), seat VARCHAR(3) )</p>