title: php mysql Maximum execution time of 300 seconds exceeded_fatal error
body: <p>I am querying data from a database, and the query clause varies with the day.
  In other words, I want to get data in one-day unit by counting seconds in unix timestamps.</p>
  
  <p>So, what I did for one-day-query is, </p>
  
  <pre><code>SELECT IDnum, Timestamp FROM table_name
  WHERE CONVERT(Timestamp, UNSIGNED INTEGER) &gt;= ($start_tim-86400*($i+1))
    AND CONVERT(Timestamp, UNSIGNED INTEGER) &lt; ($start_time-86400*$i)
  </code></pre>
  
  <p>because Timestamp attribute in table is varchar(32), I used CONVERT() in where clause to convert it to int, and compare with int type of 86400.</p>
  
  <p>This query clause works so far, but it takes at least 5 mins in that I set ini_set('max_execution_time', 300). And after 5 mins, it showed 
  "Fatal error: Maximum execution time of 420 seconds exceeded in C:\www\LineChartOne\generateJSONdata.php on line 90", and still not complete.</p>
  
  <p>My question is why it need so much time and, because I used function call in the "where clause"? Or something wrong with the "where clause", otherwise it should not run so slowly.</p>