Link to home
Create AccountLog in
Avatar of Nura111
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";
Avatar of Walter Ritzel
Walter Ritzel
Flag of Brazil image

That should be one database at a time. In the same way I have answered you before, you can have one user account with permissions on several other database and from this account you can issue commands like this:

DELETE FROM <database name>.wp_posts WHERE post_type = "revision";
Avatar of Nura111
Nura111

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
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

ASKER CERTIFIED SOLUTION
Avatar of Walter Ritzel
Walter Ritzel
Flag of Brazil image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Sorry, just realized you were trying to only delete revisions.