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.
Related Posts:
- $wpdb->get_results(…) returns empty array despite correct query
- WPDB: how to get the value of a field in a custom database table
- Get stock by custom meta field on all Woocommerce variable products
- Display fields as values in array from external SQL DB
- Querying wpdb using PHP
- $wpdb->insert() does not Insert record in a table
- Use $wpdb or other PHP script method to find/replace in WP database
- How can I add a new row in a separate database when someone registers via WordPress?
- PHP -> SQL Query with Summing
- Why my query does not run with prepare
- wpdb getting avatars and author url
- WordPress SQL JOIN query
- Fetching review value using wpdb class
- Database SQL query error
- WordPress SQL Prepare
- Creating multiple tables with Plugin
- Querying multiple meta_keys in WordPress SQL query
- Can’t send form data to wpdb when URL has query string
- How to get the list of WooCommerce product image of a certain category from database?
- Alter query on edit.php
- queries inside of a class
- How to Join two tables from separate databases within WordPress
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- Enhanced WordPress Search
- Automatically generate Post/Page from searched Database item?
- register_activation_hook isn’t adding table to DB
- How to display posts of specific category using a custom Query in WordPress?
- Renaming post IDs – Okay to do?
- How to generate page content from database the right way?
- Ajax $wpdb not returning table data
- Converting MYSQL to WordPress $WPDB
- How to Fetch values from WP database based on selected option value by onchange using PHP?
- phpMyAdmin displays error when importing database
- Preferred Method of debugging a wordpress SQL calls?
- Why is variable not working on custom sql query using wpdb?
- Can’t get wp_insert_post to work
- Trying to establish connection to External Database
- Getting id of poll from WP database
- How to insert a single row to WP database table?
- I want to select the from values from database in WordPress? [closed]
- Importing Geo data into wordpress database
- $wpdb->update with multiple parameters gives error
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- wp query foreach deleting record returning only first or last item
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Error using WordPress $wpdb object to get result from custom table
- How to retrieve the data from the sever and displaying it in a page?
- how to get serialized post meta
- How to Update post_modified of all wordpress post
- Basic wpdb update question
- wpdb Cannot Update column in Database
- Lost in trying to create user database system
- Pull MySQL data from multiple tables and merge into 1 PHP array
- Cannot access $wpdb, comes back NULL
- How do I prepare strings for insertions as values into a MySQL table?
- WPDB – Read and write value from / to database
- form $_post action value gets truncated after it passes through two forms
- How to Generate a list of Most Commented post?
- Why won’t this wpdb get_results query return results?
- Undefined variable: row?
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- making php value numeric
- Using color schemes with Color Picker
- populate select options from extra mysql table data
- quotes problem in very simple sql
- Add posts to custom table in database instead of wp_posts
- get_terms with specific id order
- get different meta-data of a complicated query at the same time
- Build A Custom SQL Query for WordPress Search
- How to run complex query using PHP
- Storing huge number of users in wordpress
- Custom User registration system
- How to use Multi SQL Database in WordPress?
- Conditional formatting on data fetched from MYSQL
- Using wpdb to connect to a different database is not working
- Looping through custom data in a custom table to display all items in a post
- Displaying SQL query result from user input via wpdb
- How do I create a WP endpoint that retrieves all custom post types that have a tag?
- How do I get data from my database into my Custom Export Field
- How to grab data from input and store it into custom table in database?
- Update user_email via php – WP 4.7
- direct query to post_meta table
- Unable to pass variable to database
- What to create new post using wp_insert_post, but it repeat the post infinitely
- Conditional statement within WP SQL query
- Passed variable gets undefined variable error on insert on next page
- Run insert if no entry otherwise run update with ajax
- See output of a sql query while plugin installation in wordpress
- How can I order metaboxes in my posts in WordPress?
- MySQL database migration to WordPress
- How do you get a reference to $wpdb in a PHP script
- WordPress Query -> Ajax Query
- how to display tables via ajax
- Changing regular db connection to $wpdb
- $wpdb how to make a record lookup
- Error resetting database index using ALTER TABLE in $wpdb->query
- How to sort search result by post_title, then by post_content
- WordPress / PHP: Check if column has value and then check if value in array
- get_var not returning a value when the field contains an apostrophe