Hi all,
My first post here...
I have been asked to create a very small db to collect data that will have something like:
name, surname, mot_expire_date
What I am looking for is the code to retrieve the entries that have mot_expire_date due in the next 30 days.
So far I been trying the following with no results at all
//database variables
$host = 'localhost';
$user = '**';
$passwd = '**';
$database = 'amt_dates';
$connect = mysql_connect($host, $user, $passwd);
$table_name = 'dates';
//query
$query = "SELECT *
FROM $table_name
WHERE mot_expire_date >= SUBDATE(mot_expire_date, INTERVAL 30 DAY)";
Any help is much appreciated.