title: php mysql: syntax date with hour
body: <p>I am trying to display the data starting at 23 on the previous day until 01 o'clock.</p>
  
  <pre><code>$query=mysql_query("select fe1a.* from fe1a WHERE fe1a.waktu_fe1a &gt;= '%$tanggal_awal%' 
  23:00:00 + INTERVAL -1 DAY  AND fe1a.waktu_fe1a &lt;  '%$tanggal_awal%' 01:00:00 ");
  </code></pre>
  
  <p>and i use <code>'%$tanggal_awal%'</code>  To catch date value from calendar <code>tanggal_awal=$_POST['tanggal_awal'];</code></p>
  
  <p>It's not working. I think there is a mistake in the syntax, <code>'%$tanggal_awal%'</code> 23:00:00. It work if i change the script to <code>WHERE fe1a.waktu_fe1a &gt;= '%$tanggal_awal%'</code> or WHERE <code>fe1a.waktu_fe1a like '%$tanggal_awal%'</code> or something without hour.</p>
  
  <pre><code>fe1a.waktu_fe1a datetime
  </code></pre>
  
  <p>can you help me correct this syntax?</p>