ebchost Posted July 17, 2011 Share Posted July 17, 2011 i try to build counter with mysql mysql_query("INSERT INTO `rss_visitor` VALUE ('','$ip','$id_kor','$date1', '$date2','$opcija') ") or die(mysql_error()) format of date1, 2 is $date1 = date('Y-m-d'); $date2 = date('H:m:s'); this code is ok and work. Q: How to present with mysql all data from today ? or before 2 day, .... etc... SELECT * FROM `rss_visitor` WHERE ? // what go hiar Quote Link to comment https://forums.phpfreaks.com/topic/242212-date-query/ Share on other sites More sharing options...
fenway Posted July 17, 2011 Share Posted July 17, 2011 You really shouldn't store date & time separately -- nor should you omit the field names. CONCAT( date1, ' ', date2 ) > NOW() - INTERVAL 2 DAY Quote Link to comment https://forums.phpfreaks.com/topic/242212-date-query/#findComment-1243902 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.