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

Christopher Joseph christopher at ideadesigners.com
Tue Jan 20 09:05:58 CST 2004


could you not use the SQL function CURDAT() or similar and possibly 
DATE_FORMAT(date,format) to set both date formats to the same?

select meetings from table where date >= CURDATE() order by date

http://www.mysql.com/doc/en/Date_and_time_functions.html



kris burford wrote:

> 
>> 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.
>>
>> I've googled this to death, but I must be losing my search technique 
>> cos I've yet to solve my problem - can anyone help?
>>
>> Unix server, PHP page outputting XHTML 1.0, MySQL 4.0.16-Max.
> 
> 
> depending on how you're storing dates (unix timestamp? mysql date 
> format? other?) set $date to the same format then just query the 
> database for records to fit
> 
> eg if unix timestamp
> $date = mktime();
> $sql = "select meetings from table where date >= '$date' order by date";
> $results = mysql_query($sql, your_connection_stuff_here);
> 
> hth
> 
> kris
> 

-- 
Christopher Joseph

-------------------
[Internet]
http://www.ideadesigners.com  [iseries & web technologies]
mailto: christopher at ideadesigners.com

[Telephone]
mobile:   +44 7966 003860
Office:   +44 1494 731814 ext. 832
Direct:	  +44 1494 731832

[Instant Message]
ICQ: 78019724
YIM = Josephc_98
MSN = christopher at ideadesigners.com



More information about the thelist mailing list