[thelist] Displaying Records By Date Later Than Current Date (MySQL + PHP)

Mike evolt at muinar.com
Wed Jan 21 07:37:46 CST 2004


At 12:57 20.01.2004 +0000, you wrote:
>Hello all,
>I have a table in my database called "meetings". There are various fields, 
>but the crucial one here is "date".
>This table stores all the meetings that my client is holding or has held. 
>For a "forthcoming meetings" page, I need to display any meetings that 
>have a date later or equal to today's date.

With MySQL's built-in variables you can achieve this with one line of code:

$query = "select * from $dbTable where TO_DAYS( date ) - TO_DAYS( NOW( ) 
) >= 0 order by date";

Mike

_____  mike s. krischker  http://webdesign-schweiz.ch/
        flashpro mailing list  http://flash-list.com/
        royalty free flash sounds  http://flash-sounds.com/




More information about the thelist mailing list