title: Php form data won't insert data on my PhpMyAdmin database
body: <p>I've been trying to resolve this but i can't see the error. please help me. This is my code so far. What should i do? i checked every detail but cant find it. when i click the button, there's no error and it will return in the reservation.php page. I also have a "res_id" in my database which is auto increment. how should i include it in the insert statement?</p>
  
  <p>Php code:</p>
  
  <pre><code>&lt;?
  
  $conn = mysqli_connect("localhost","root","") or die(mysql_error());
  mysqli_select_db("hoteldb",$hoteldb) or die("no db found");
  
  if(isset($_POST['confirm'])){
      $fname= $_POST['fname'];
      $lname= $_POST['lname'];
      $contact= $_POST['contact'];
      $username= $_POST['username'];
      $password= $_POST['password'];
      $email= $_POST['email'];
      $address= $_POST['address'];
      $checkin= $_POST['checkin'];
      $checkout= $_POST['checkout'];
  
      $query="INSERT INTO reservation(fname,lname,contact,username,password,email,address,checkin,checkout)
      VALUES ('$fname','$lname','$contact','$username','$password','$email','$address','$checkin','$checkout')";
  
      mysql_query($query,$conn);
      mysqli_close($conn);
  }
  ?&gt;
  </code></pre>
  
  <p>Html code:</p>
  
  <pre><code> &lt;form action="reservation.php" method="post"&gt;
                          &lt;div&gt;
                              &lt;label&gt;Title:&lt;/label&gt;
                              &lt;select name="title"&gt;
                                  &lt;option value="ms"&gt;Ms.&lt;/option&gt;
                                  &lt;option value="mr"&gt;Mr.&lt;/option&gt;
                                  &lt;option value="mrs"&gt;Mrs.&lt;/option&gt;
                                  &lt;/select&gt;    
  
                          &lt;/div&gt;
                          &lt;div &gt;
                              &lt;label&gt;First Name:&lt;/label&gt;
                              &lt;input type="text" name="fname"&gt;
                          &lt;/div&gt; 
                          &lt;div&gt;
                             &lt;label&gt;Last Name:&lt;/label&gt;
                             &lt;input type="text" name="lname"&gt;
                          &lt;/div&gt;
                          &lt;div&gt;
                              &lt;label&gt;Phone Number:&lt;/label&gt;
                              &lt;input type="text" name="contact"&gt;
                           &lt;/div&gt;
                          &lt;div&gt;
                              &lt;label&gt;Username:&lt;/label&gt;
                              &lt;input type="text" name="username" &gt;
                          &lt;/div&gt;
                          &lt;div &gt;
                              &lt;label&gt;Password:&lt;/label&gt;
                              &lt;input type="password" name="password" &gt;
                          &lt;/div&gt;
                          &lt;div &gt;
                              &lt;label&gt;Email Address:&lt;/label&gt;
                              &lt;input type="text" name="email" &gt;
                          &lt;/div&gt;
                          &lt;hr&gt;
                          &lt;h5&gt;Address&lt;/h5&gt;
                              &lt;div &gt;
                                  &lt;label&gt;Full Address:&lt;/label&gt;
                                  &lt;input type="text" name="address" &gt;
                              &lt;/div&gt;
                          &lt;hr&gt;
                          &lt;h5&gt;Date&lt;/h5&gt;
                          &lt;div &gt;
                              &lt;legend&gt;Check-in&lt;/legend&gt; 
                              &lt;input type="date" name="checkin"&gt; 
  
                              &lt;legend&gt;Checkout &lt;/legend&gt; 
                              &lt;input type="date" name="checkout"&gt;
                          &lt;/div&gt;
                          &lt;input type="submit" name="confirm"&gt;
                      &lt;/form&gt;
  </code></pre>
  
  <p>or is it because of the date picker? if so, can you please teach me how to use the date picker? its my first time using it. Thank you! :)</p>