php-db | 2001051
Date: 05/03/01
- Next message: Gyozo Papp: "Re: [PHP-DB] Excluding values of one array from another (sort of)"
- Previous message: martin helie: "[PHP-DB] Mystery variable query?"
- In reply to: martin helie: "Re: [PHP-DB] mysql/php select using date in where clause"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
IT works!
Thanks!
""martin helie"" <martinh <email protected>> skrev i en meddelelse
news:9crqud$voj$1 <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 record dates...
>
> Martin
>
>
>
> ""Dan Eskildsen"" <dan <email protected>> wrote in message
> news:9crq7l$mfb$1 <email protected>
> > ***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
> > $today=date("Y-m-d");
> > $lastmonth = $today-30
> >
> > $query = "SELECT * FROM customers WHERE Site='egebjergnet' AND
> > DatoOprettet>'$lastmonth' ORDER BY FirmaNavn";
> >
> >
> > AND I get an error, of course. hmmm
> > --
> > ==================================
> > Regards from Denmark, Europe
> > Please cc your reply to dan <email protected>
> > ==================================
> > I haven't lost my mind, I've got it backed up on TAPE somewhere.......
> >
> >
> >
> >
> > --
> > 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>
> >
>
>
>
> --
> 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>
>
-- 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: Gyozo Papp: "Re: [PHP-DB] Excluding values of one array from another (sort of)"
- Previous message: martin helie: "[PHP-DB] Mystery variable query?"
- In reply to: martin helie: "Re: [PHP-DB] mysql/php select using date in where clause"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

