title: How to pass foreign key for creating table in php
body: <p>Here is my two tables , I want to pass my guest_id as a foreign key inside reservation table . but it's given error..</p>
  
  <pre><code>$sql = "CREATE TABLE MyGuests (
      guest_id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
      firstname VARCHAR(30) NOT NULL,
      lastname VARCHAR(30) NOT NULL,
      email VARCHAR(50),
      reg_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
      )";
  
  // // sql to create table
  
  $sql = "CREATE TABLE reservation (
  id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  FOREIGN KEY(guest_id) REFERENCES MyGuests(guest_id),
  room INT(11) NOT NULL,
  price FLOAT(11) NOT NULL,
  reg_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  )";
  </code></pre>
  
  <p>where is the problem ? </p>