nezbo Posted February 13, 2009 Share Posted February 13, 2009 please help me get this to work i have a hour, min, day, month, and year field my database and i want to have it only showing less that mktime() but it is not bringing anythin beck? $getManagerInfo = @mysql_query("SELECT * FROM oncall_staff, person WHERE person.CallID = oncall_staff.userID AND UNIX_TIMESTAMP('oncall_staff.StartDateYears-oncall_staff.StartDateMonths-oncall_staff.StartDateDays oncall_staff.StartDateHours:oncall_staff.StartDateMins:00') < '" . mktime() . "' AND oncall_staff.valid = 0"); while ($getManagerInfo1 = @mysql_fetch_array($getManagerInfo)) { Cheers, Nezbo Quote Link to comment https://forums.phpfreaks.com/topic/145073-unix_timestamp-help/ Share on other sites More sharing options...
rhodesa Posted February 13, 2009 Share Posted February 13, 2009 #1 Why are your year/month/day/etc in separate fields? Why aren't you just using one DATETIME field? #2 Try this: SELECT * FROM oncall_staff, person WHERE person.CallID = oncall_staff.userID AND UNIX_TIMESTAMP(CONCAT(oncall_staff.StartDateYears,'-',oncall_staff.StartDateMonths,'-',oncall_staff.StartDateDays,' ',oncall_staff.StartDateHours,':',oncall_staff.StartDateMins,':00')) < '" . time() . "' AND oncall_staff.valid = 0"); Quote Link to comment https://forums.phpfreaks.com/topic/145073-unix_timestamp-help/#findComment-761255 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.