how to delete 30 day old data using PHP [closed]

You’re adding an extra wp_ prefix to your table and your using a timestamp instead of a MYSQL datetime. Below is how WP suggests you use $wpdb->query to delete rows, taken from the codex.

EDITED

global $wpdb;

$wpdb->query(
  "DELETE FROM " . $wpdb->prefix . "userinfo
   WHERE timeall < DATE_SUB(CURDATE(),INTERVAL 30 DAY)"
);

$wpdb->prefix adds the wp_ for you.