I want to query a database for records where the date is equal to, or greater than 90 days. This is what I have so far:
$format = 'Y-m-j G:i:s';
$date = date ( $format );
// -90 days from today
date ( $format, strtotime ( '-90 day' . $date ) );
I'm just a bit unsure now how to structure the MYSQL query. Would it be something like this (I know this is wrong but i'm unsure as to what else to do):
"SELECT * FROM recurringPayments WHERE lastpmt >= date ( $format, strtotime ( '-90 day' . $date ) ) ";
<?php
mysql_query("SELECT * FROM recurringPayments WHERE lastpmt <= (NOW() - INTERVAL 90 DAY)");
?>
<?php
$d = date ( $format, strtotime ( '-90 days' ) );
mysql_query("SELECT * FROM recurringPayments WHERE lastpmt <= '$d'");
?>
Assuming you want data 90 days and older.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With