title: SQL INSERT INTO SELECT Statement syntax issue
body: <p>I have 4 pages, across which I need to share the same restaurant_ID. I need to be able to insert the ID into all 4 tables in the database.
  I am using a <code>INSERT INTO SELECT</code> statement to do so. But I am receiving the following error:</p>
  
  <blockquote>
    <p>POSSIBLE Syntax Error (check preceding valid syntax error)
     unexpected:    identifier 'SELECT'</p>
    
    <p>POSSIBLE Syntax Error (check preceding valid syntax error)
         unexpected:    identifier 'Resturant_ID'</p>
    
    <p>POSSIBLE Syntax Error (check preceding valid syntax error)
         unexpected:    identifier 'Rest_Dets'</p>
  </blockquote>
  
  <p>This is the sql I am using:</p>
  
  <p>(Original):</p>
  
  <pre><code>  INSERT INTO Product (Resturant_ID)
    SELECT Resturant_ID Rest_Dets;
  </code></pre>
  
  <p>(Edited):</p>
  
  <pre><code>  INSERT INTO Product (Resturant_ID)
    SELECT Resturant_ID FROM Rest_Dets;
  </code></pre>
  
  <p>I have also tried</p>
  
  <pre><code>  $rest_id = mysqli_real_escape_string($dbc, $_SESSION['Resturant_ID']);
    INSERT INTO Product (Resturant_ID)
    SELECT Resturant_ID FROM Rest_Dets  WHERE Resturant_ID = $rest_id ;
  </code></pre>
  
  <p>I have looked all over the internet and it doesn't seem like I should have a problem, the webpage is also connected successfully. </p>
  
  <p>Rest_Details(The table i want to get the Restaurant_ID from)</p>
  
  <pre><code>     CREATE TABLE `Rest_Details` (
      `Resturant_ID` bigint(255) NOT NULL AUTO_INCREMENT,
      `Resturant_name` varchar(100) NOT NULL,
      `Resturant_des` varchar(200) NOT NULL,
      `Res_Address_Line_1` varchar(200) NOT NULL,
      `Res_Address_Line_2` varchar(200) DEFAULT NULL,
      `City_name` varchar(100) NOT NULL,
      `Resturant_Postcode` varchar(8) DEFAULT NULL,
      `Cat_ID` tinyint(11) NOT NULL,
      `Avg_Del` tinyint(11) NOT NULL,
      `Est_Del` tinyint(11) NOT NULL,
      `Email1` varchar(200) NOT NULL,
      `Email2` varchar(200) DEFAULT NULL,
      `Min_ord` tinyint(11) NOT NULL,
       PRIMARY KEY (`Resturant_ID`),
       UNIQUE KEY `Resturant_name` (`Resturant_name`),
       UNIQUE KEY `Resturant_ID` (`Resturant_ID`)
      ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
  </code></pre>
  
  <p>Products</p>
  
  <pre><code>   CREATE TABLE `Product` (
    `Product_Id` bigint(255) NOT NULL AUTO_INCREMENT,
    `Resturant_ID` bigint(255) NOT NULL,
    `Product_Name` varchar(100) NOT NULL,
    `Product_Desc` text NOT NULL,
    `Product_Price` decimal(65,0) NOT NULL,
    `Add_On_ID` int(11) NOT NULL,
     PRIMARY KEY (`Product_Id`),
     UNIQUE KEY `Product_Id` (`Product_Id`),
     UNIQUE KEY `Resturant_ID` (`Resturant_ID`)
     ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8
  </code></pre>