RE: [PHP] Re: best way to do this with arrays...
| From: | Michal Migurski | Date: | Mon, 24 May 2004 20:41:01 +0000 |
| Subject: | RE: [PHP] Re: best way to do this with arrays... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-186848@lists.php.net to get a copy of this message | ||
> the tricky part is I could have fifteen rows in the db all with
> different start and end dates that I need to check each day against.
Then do the data comparison in the DB --
SELECT * FROM your_table
WHERE {$check_time} >= start_time
AND {$check_time} <= end_time;
(Adjust as appropriate for date formatting, SQL injection, etc.)
If you're using MySQL, this page is informative:
http://dev.mysql.com/doc/mysql/en/Date_and_time_types.html
-mike.
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html