I am mysql beginner, how to delete 30 day old data using php?
This code is not working?
global $wpdb;
$table = $wpdb->prefix . "userinfo";
$delete_rows ="DELETE * FROM $table WHERE timeall <".strtotime('-1 month');
$wpdb->query($table, $delete_rows);
$wpdb->prefix . "wp_userinfo"
would equate to wp_wp_userinfo. If you're using $wpdb->prefix, you don't need to add the prefix yourself. Just change to$wpdb->prefix . "userinfo"