You are here: Re: checking a date... « All PHP « IT news, forums, messages
Re: checking a date...

Posted by pidipady on 10/11/52 11:53

You could try:
_________________________________________________
$query = "SELECT * FROM members WHERE mem_date <
DATE_SUB(CURDATE(),INTERVAL 30 DAY)";
$return = mysql_query($query) or die(mysql_error());
___________________________________________

Note The DAY number (30) Change to what you need

Pidipady - http://www.pichpatterns.com

Mike wrote:
> I have a need to check if a users yearly subscription has expired.
>
> So how do I...
>
> a) get the current date plus 1 year so I can store this in a db. I've
> looked at mktime() but this just adds 1 to the year. What happens if
> the current date is feb 29th. If its a leap year next year feb the
> 29th won't happen?
>
> b) check that the current date isn't more than that date in the db?
>
> Many Thanks
>
> Mike

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация