[PHP] Include today's date in a SQL statement?

2003-02-05 Thread Brian Dunning
What would the SQL be to find a record where:

  start_date  today = end_date

Thanks,
- Brian


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Include today's date in a SQL statement?

2003-02-05 Thread Jon Haworth
Hi Brian,

 What would the SQL be to find a record where:
start_date  today = end_date

... WHERE start_date  today AND today = end_date

If you're asking how do I get today's date into an SQL statement, there
are two ways:
 - use your DBMS's built-in function to get today's date
 - use PHP's date() function to format a timestamp as -MM-DD 

Cheers
Jon



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include today's date in a SQL statement?

2003-02-05 Thread Jonathan Pitcher
Brian,

$Today = // Date format that you use that can be compared to the date 
stored in the database.

$Query = WHERE start_date  $Today and end_date =$Today;

I just showed the where statement of the query.  You can add in any 
statement you want before that to select or manipulate data based on 
the results.

Jonathan Pitcher
Webmaster Capitol Federal Savings

On Wednesday, February 5, 2003, at 09:14  AM, Brian Dunning wrote:

What would the SQL be to find a record where:

  start_date  today = end_date

Thanks,
- Brian


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php