php - Codeigniter: Compare a MySql Datetime with Current Date -


i need compare mysql datetime current time, datediff show messange if mysql datetime, less 30 days today.

i'm using codeigniter, , tried lot of helpers, , lots of thing, can't work.

some people says better save in database timespan, don't know wich 1 best aproach.

thanks in advance!

edit: i'm looking ci code, or mysql code, or both, work. doesn't matter current date (could mysql or server time). also, have needed code on view, , controller, need model code it, or mysql code

select datediff(curdate(),your_mysql_date_field) your_table 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -