title: Validation Appointment form
body: <p>I'd like to ensure that the client are unable to book the same date/time for the same services that the company caters to. The codes are as follow for the fields:</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="label"&gt;Appointment Type:&lt;/div&gt;&lt;!-- end .label--&gt;
      &lt;div class="input"&gt;
      &lt;select input type="text" id="Booking" class="detail" name="ApptType" value=""&gt;
      &lt;option value=""&gt;Appointment for&lt;/option&gt;
      &lt;option value="Consultation"&gt;Consultation&lt;/option&gt;
      &lt;option value="Photo Shoot"&gt;Photo Shoot&lt;/option&gt;
      &lt;option value="Dress Fitting"&gt;Dress Fitting&lt;/option&gt;
      &lt;/select&gt;
      &lt;/div&gt;&lt;!-- end .input --&gt;
      &lt;/div&gt;&lt;!-- end .row --&gt;
  
      &lt;div class="row"&gt;
      &lt;div class="label"&gt;Select Date and Time:&lt;/div&gt;&lt;!-- end .label--&gt;
      &lt;div class="input"&gt;
      &lt;input type="text" id="DateTime" class="detail" name="DateTime" value=""&gt;
      &lt;/div&gt;&lt;!-- end .input--&gt;
      &lt;/div&gt;&lt;!-- end .row --&gt;
  </code></pre>
  
  <p>I'd like a rule, where clients that book an appointment for consultation (ApptType) at (for instance) 10 Dec 2014 at 2pm, other clients aren't able to book for same date or time. I'm still a novice in this but i tried on this code after searching up codes (for my database.php):</p>
  
  <pre><code> $bookingdatetime = $_POST[DateTime];
    $apptdatetime = Appt_DateTime;
  
  $conn = dbConnect();
  
  if (! $conn)
  
      die("Couldn't connect to MySQL");
  
      if  ($apptdatetime != $bookingdatetime);
  
      return false;
  
  } else { 
  
      return $sql = "INSERT INTO Appointment (Client_ID,Svc_ID,Appt_DateTime) 
  VALUES ('$_POST[ClientID]','$_POST[ApptType]','".date('Y-m-d H:i:s', strtotime($_POST[DateTime]))."')";
  
  
  mysql_query($sql,$conn);
  </code></pre>
  
  <p>There is no error written in dreamweaver tho. can someone help, now i can't even store the data in my database after inserting the rules.</p>