title: compare time using sql query
body: <p>I am working on attendance management system using php and mysql. I want to display the total number of times a person spending less than 9 hrs a day. <code>timein</code> and <code>timout</code> is been stored in database. I used the query:</p>
  
  <pre><code>SELECT * FROM presence 
  WHERE 'timeout' - 'timein' &lt; 9 AND  uid=".$uid1[$i]."
  AND date BETWEEN'".$date1."' AND '".$date2."'");
  
  echo "&lt;td align='center'&gt;".mysql_num_rows($recordset)."&lt;/td&gt;"; 
  
  $lateout1 = mysql_num_rows($recordset);
  </code></pre>
  
  <p>But nothing is displayed. Please help me to display the number of days for all users spends less than 9 hrs a day.</p>