[PHP-DB] mysql/php select using date in where clause

2001-05-03 Thread Dan Eskildsen
***NEWBIE ALERT*** (I am only very new at this) PHP and MySQL OK - I have a table with data and one of the fields is a Date field. Now I would like to SELECT all records where the date is less that 45 days old. Eh, How do I do that? I have tried this: #Declaring variables

Re: [PHP-DB] mysql/php select using date in where clause

2001-05-03 Thread martin helie
Here's how I'd do it: SELECT * FROM customers WHERE Site='egebjergnet' AND TO_DAYS(NOW()) - TO_DAYS(date_column) = '45' where date_column contains record dates... Martin Dan Eskildsen [EMAIL PROTECTED] wrote in message 9crq7l$mfb$[EMAIL PROTECTED]">news:9crq7l$mfb$[EMAIL PROTECTED]...

Re: [PHP-DB] mysql/php select using date in where clause

2001-05-03 Thread Dan Eskildsen
IT works! Thanks! martin helie [EMAIL PROTECTED] skrev i en meddelelse 9crqud$voj$[EMAIL PROTECTED]">news:9crqud$voj$[EMAIL PROTECTED]... Here's how I'd do it: SELECT * FROM customers WHERE Site='egebjergnet' AND TO_DAYS(NOW()) - TO_DAYS(date_column) = '45' where date_column contains