

Then you can use this log to get keys of main table rows that was created before specific time and delete corresponding records. CREATE TRIGGER logCreator AFTER INSERT ON MainTable If there is no column with timestamp of a row creation in your table, then you can create trigger that will insert current timestamp and inserted row identificator to auxiliary table. Notice the WHERE clause in the DELETE syntax: The WHERE clause specifies which record or records that. Now select operations and click on drop the database as shown in the screenshot below. Delete Data From a MySQL Table Using MySQLi and PDO. arkascha at 18:31 arkascha I suspect he meant phpMyAdmin, I've updated it accordingly. Go the phpMyAdmin home page and select the database which you want to delete.

There is no such thing as a 'phpMySQL data base'. WHERE `timestamp_column` < CURRENT_TIMESTAMP - INTERVAL 6 MONTH 1 DELETE FROM tablename WHERE column 'param' Adam at 18:27 I suggest you edit your questions title. For example CREATE EVENT cleaning ON SCHEDULE EVERY 1 MONTH ENABLE To enable it use SET GLOBAL event_scheduler = ON Īfter that you could crate event that will check rows creation time and delete old records.
#Phpmyadmin delete database entry how to
There is detailed example in my post on the Stack Overflow, you just need to change time interval value from 24 hours to 6 months.įirstly, make sure the Event Scheduler is enabled. How to Delete Record from database from HTML PHP Web Page Hello friends in this video i will teach you all about how you can c. The Event Scheduler allows to execute regular events according to a schedule.
