title: "Error in your SQL syntax; check the manual that corresponds to your MySQL server version" PHP Issues with Time Comparison
body: <p>Every time I try to format a php MySQLi Query, I keep getting a formatting error that tells me to check the manual - although Im not sure what exactly is wrong with it.</p>
  
  <pre><code>$timeCheckEmp1 = "SELECT * FROM employee1 
     WHERE employee1.starttime BETWEEN $appointmentDateTime AND $endDateTime 
       OR $appointmentDateTime BETWEEN employee1.starttime AND employee1.endtime"    
  
  $getResultEmp1 = mysqli_query($link, $timeCheckEmp1) or die(mysqli_error($link));
  </code></pre>
  
  <p>For the record, I have tried converting the queued dates as both strings and dateTime values, and I still get the error.  </p>
  
  <p>The only help the PHP server is giving me is that it is occuring around the <code>"AND ($endDateTime value) OR  (appointmentDateTime value) BETWEEN employee1.starttime AND employee1.endtime"</code>.</p>
  
  <p>Any advice is advice is appreciated.</p>