Hi,
I am trying to pull all records from a database where the join date is exactly 3 days past today's date. New records will be added to this database on a daily basis, so I have to make sure not to pull any of the newer records in the process. The code that I have is as follows:
//Get today's zero hour timestamp
$senddate = mktime (0,0,0,date("m"),date("d")-1,date("Y"));
$query = "SELECT userid, joindate, email
FROM user
WHERE DATE_ADD(joindate, INTERVAL 3 DAY) = '$senddate';";
('joindate' is a date stored as a timestamp in the database.) I know that my code above will not work, because the joindate column in the database also contains the time information from when the record was initially entered. I have no way of controlling this.
Does anyone have any ideas on how I can find a solution to my problem? (And yes, I have looked at MySQL Manual 6.3.4 Date and Time Functions Chapter, but I think I am just not putting things together correctly...) 🙁
Please help a frustrated soul!
Thanks!