php-db | 2001051
Date: 05/02/01
- Next message: Benny: "[PHP-DB] updating database on internet server"
- Previous message: Mike Baerwolf: "[PHP-DB] Date Ranges"
- In reply to: Mike Baerwolf: "[PHP-DB] Date Ranges"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
if you have a table with a date field, you can write a query that will look
something like this:
// assuming these dates
$start_date = '2001-02-05';
$end_date = '2001-07-05';
// sql query
SELECT * FROM events_table WHERE date_field >= '$start_date' AND date_field
<= '$end_date';
this would result in all events starting Feb 02, 20001 and ending July 05,
2001
depending on your requirements you can use the following comparison
operators:
for $start_date:
= equal to
>= Greater than or equal to
> Greater than
for $end_date:
= equal to
<= less than or equal to
< less than
Hope this helps.
-----Original Message-----
From: Mike Baerwolf [mailto:mike <email protected>]
Sent: Wednesday, May 02, 2001 5:11 PM
To: php-db <email protected>
Subject: [PHP-DB] Date Ranges
Hi,
I'm working on a event calendar and some events span more than one day. I
would like to store a date range like 2001-02-05 thru 2001-07-05 so when I
do a query for the current day the event would appear for all the days in
the range. I hoping someone can point me to some documentation or tutorials
on this.
Thanks in advance,
Mike
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Benny: "[PHP-DB] updating database on internet server"
- Previous message: Mike Baerwolf: "[PHP-DB] Date Ranges"
- In reply to: Mike Baerwolf: "[PHP-DB] Date Ranges"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

