I have date value saved in Mysql DB, with format "dd.mm.yyyy", now I want to delete all records that date is older than 10 days from today, how can I do that in php? is there php function can calculate previous date? thanks for any help.

Yes, there are date funcitons in php that will do the calculations for you, but you can do it directly in the sql statement, like:

DELETE from TABLENAME where DATEFIELDNAME < (CURDATE() - INTERVAL 10 DAY);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.