You have a couple of different options, and your best bet is to use the MySQL date functions.
I have a similar system, and I find it easiest to work with unix timestamps. If it were up to me, this is how I would do it:
Code: Select all
<?php
$over7 = strtotime("+7 days");
mysql_query("SELECT control_number FROM cases WHERE sent_to_customer = false AND UNIX_TIMESTAMP(due_date) >= '$over7'");
?>
Now, you may notice some quirks, depending on how important it is that you return results within 7 days from this very second. Since your db only stores your date in the 0000-00-00 format, I believe when the unix timestamp is created, it sets the time as 00:00:00 (12 am). If you need a finer resolution, you can modify your $over7 variable to something like this:
Code: Select all
<?php
$sTimeInMorning = date('Y-m-d');
$over7 = strtotime($sTimeInMorning);
?>