MDanz Posted December 6, 2009 Share Posted December 6, 2009 how do i do this? elseif (NOW()-$timeposted>) { after the greater than sign in the if statement.. how do i do a week? . btw $timeposted is in format date and time e.g. elseif (NOW() - $timeposted > a week) Link to comment https://forums.phpfreaks.com/topic/184195-help-with-if-statement/ Share on other sites More sharing options...
greatstar00 Posted December 6, 2009 Share Posted December 6, 2009 (NOW() - unix_timestamp($timeposted)) > 86400*7 //86400 = second in a day Link to comment https://forums.phpfreaks.com/topic/184195-help-with-if-statement/#findComment-972466 Share on other sites More sharing options...
MDanz Posted December 6, 2009 Author Share Posted December 6, 2009 thx i tried it.. i get this error message Call to undefined function NOW() ... i changed NOW() to $date ............$date = date( "d/m/Y", time() ); and i got Call to undefined function unix_timestamp.. those are mysql functions so how do i make them work with php? Link to comment https://forums.phpfreaks.com/topic/184195-help-with-if-statement/#findComment-972474 Share on other sites More sharing options...
greatstar00 Posted December 6, 2009 Share Posted December 6, 2009 i am sorry, i didnt check the syntact too (time() - strtotime($timeposted)) > 86400*7 Link to comment https://forums.phpfreaks.com/topic/184195-help-with-if-statement/#findComment-972478 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.