note 10845 added to date
| From: | maus at tmaus dot com | Date: | Tue, 23 Jan 2001 18:05:20 +0000 |
| Subject: | note 10845 added to date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-10185@lists.php.net to get a copy of this message | ||
I hab some good advice from here, too.
thanks to tom@subblue.com
So, here's my advice for this messageboard:
To select all fields between now and 14 Days ahead you can simply query the mysql database with a
this sql (datum is a date-field). It formats the result as well(dd.mm.YYYY). But note:
It's better programming to reformat and choose by the programm rather than by sql!
$sql = "SELECT DATE_FORMAT (datum, 'e.c.Y')";
$sql .= " from table";
$sql .= " WHERE";
$sql .= " (datum BETWEEN";
$sql .= " SYSDATE() AND DATE_ADD(NOW(), INTERVAL 14 DAY))";
http://www.php.net/manual/en/function.date.php