PHP/MYSQL Delete data when expire -
i have custom classifieds website, , in mysql have date_created , date_expire. want make script delete ads when expired. mysql table called: "ads" , has these columns: "id" "name" "email" "ad_headline" "date_created" "data_expirare" (this date when ad expire)
here i've tried: http://pastebin.com/gd56bawy
what you'd want run cron job every day or (0 0 * * *
). you'd create php file in case, within it, run following query:
delete ads data_expirare < now();