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 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 Link to comment https://forums.phpfreaks.com/topic/242212-date-query/#findComment-1243902 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.