Hello Forums:
I need to get the hour difference from two columns in this table and insert it in hours_today column:
here’s my query to get the difference in seconds
$q = mysql_query(“SELECT UNIX_TIMESTAMP(s_out) - UNIX_TIMESTAMP(s_in) AS dif FROM sd_record WHERE id = 1”);
Problem is how do I apply this arithmetic inside the query:
floor(dif / (60 * 60)) -> to convert seconds to hours
thnx