Logical1 Posted August 1, 2009 Share Posted August 1, 2009 Hello I save the date of record creation in a colum called PDate in MySQL and use the following querry: $Tdate = date('Y').date('m').date('d'); $query = "SELECT Id FROM tblItems $TDate-PDate < '3' AND Status = '1'"; This is to show only records that are less than 3 days old. This method has always worked but suddenly I am getting no answers! I did some tests and I see that if : TDate = 20090801 PDate = 20090729 What am I doing worng? Link to comment https://forums.phpfreaks.com/topic/168446-query-with-time-difference/ Share on other sites More sharing options...
bundyxc Posted August 2, 2009 Share Posted August 2, 2009 Hint: Variables are case sensitive. Link to comment https://forums.phpfreaks.com/topic/168446-query-with-time-difference/#findComment-888577 Share on other sites More sharing options...
Logical1 Posted August 2, 2009 Author Share Posted August 2, 2009 I know I typed it here wrong in the actual code it is typed correctly. Link to comment https://forums.phpfreaks.com/topic/168446-query-with-time-difference/#findComment-888582 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.