Jump to content

date


coolphpdude

Recommended Posts

hi there,

 

I need help with formatting a search query. I have a database of memo's for a user, each memo has an expiry date, i only want to display the memo's to the user that have not yet expired. so for example I have a memo that is no use past the 20th of june so i set the expirary date in the database to 2008-06-20. This memo will be shown until and including the the 20th of june. Come the 21st of June that memo will no longer be displayed. how do i include that in my search query???

 

so far ive got this,

 

$memo_result = mysql_query("SELECT * FROM memos WHERE username='$user'", $db);

 

This works and all memos are displayed but i need to add something along the lines of:-

 

$memo_result = mysql_query("SELECT * FROM memos WHERE username='$user' AND curdate <= 'expirary_date'", $db);

 

Can anyone help?

 

Link to comment
https://forums.phpfreaks.com/topic/110046-date/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.