In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
> I'm sorta new at php, as most of my experience is in ASP...so I need a
> little help.
> I am making a "next upcoming event" script. Basically, I want to be able to
> put into mysql a description of the even and a date where the posting should
> start, and I want to be able to make it show the most recently passed post
> date. So in other words, if today is June 1 2002, and I have 3 records with
> post dates of May 28, March 22, and June 13 of that year, I want it to show
> the May one. How do I sort this? I know that in ASP it would be "SELECT text
> FROM events WHERE date < " & now() & "SORT BY date DESC", but how do I do it
> in php?
It depends on the column type you use to store your dates; have a look at
the date functions in Mysql, and also have a look at LIMIT which will
allow you to return just one record from a SELECT.
I assume you are aware of the mysql functions in PHP so I won't go into
Quod subigo farinam
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php