Re: Upcoming event script

From: Date: Mon, 13 May 2002 01:58:39 +0000
Subject: Re: Upcoming event script
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19142@lists.php.net to get a copy of this message
In article <20020512074404.3719.qmail@pb1.pair.com>, andrew.sullivan@clandb.com 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 them. -- David Robley Temporary Kiwi! Quod subigo farinam

« previous php.db (#19142) next »