Nura111
asked on
How to delete from multiple Database
I want to perform a delete query as the next one
on different databases
DELETE FROM wp_posts WHERE post_type = "revision";
on different databases
DELETE FROM wp_posts WHERE post_type = "revision";
ASKER
yes all the databases are in one place can i
DELETE FROM <database name>.wp_posts WHERE post_type = "revision";
union <database name>.wp_posts
union <database name>.wp_posts
DELETE FROM <database name>.wp_posts WHERE post_type = "revision";
union <database name>.wp_posts
union <database name>.wp_posts
you are better off using the Class provided to you by Wordpress for interacting with the database
http://codex.wordpress.org/Function_Reference/wpdb_Class
More specifically, delete posts with wp_delete_post() or risk leaving behind things like comments and meta data.
http://codex.wordpress.org/Function_Reference/wp_delete_post
http://codex.wordpress.org/Function_Reference/wpdb_Class
More specifically, delete posts with wp_delete_post() or risk leaving behind things like comments and meta data.
http://codex.wordpress.org/Function_Reference/wp_delete_post
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Sorry, just realized you were trying to only delete revisions.
DELETE FROM <database name>.wp_posts WHERE post_type = "revision";