title: I am not able to insert the data into database mysql
body: <p>I am trying to input these values into database but everytime there is an error. I think the error is in this part of code but i am not able to find it plzz help.  </p>
  
  <pre><code>&lt;?php
  
      if ($roomtype == "DeluxeRoom")
          {
          $rom = "SELECT room_id FROM room WHERE room_id NOT IN ( SELECT room_id 
          FROM reservation WHERE start_date &lt;= '2016-02-27' AND end_date &gt;= '2016-02-
          24')";
          }
  ?&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;?php
  session_start();
  include_once 'database.php';
  
  if (isset($_POST['signup']))
      {
      $checkin = mysqli_real_escape_string($con, $_POST['checkin']);
      $checkout = mysqli_real_escape_string($con, $_POST['checkout']);
      $numroom = mysqli_real_escape_string($con, $_POST['numroom']);
      $roomtype = mysqli_real_escape_string($con, $_POST['roomtype']);
      $cid = $_SESSION['usr_id'];
      if ($roomtype == "DeluxeRoom")
          {
          $rom = "SELECT room_id FROM room WHERE room_id NOT IN ( SELECT room_id 
      FROM reservation WHERE start_date &lt;= '2016-02-27' AND end_date &gt;= '2016-02-
      24')";
          }
  
      $sql = "INSERT INTO reservation (customer_id,room_id,start_date, end_date) 
      VALUES('" . $cid . "','" . $rom . "','" . $checkin . "','" . $checkout . "')";
      if (mysqli_query($con, $sql))
          {
          echo "New record created successfully";
          }
        else
          {
          echo "Error";
          }
      }
  
  ?&gt;
  </code></pre>