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";
MySQL ServerWordPressSQL

Avatar of undefined
Last Comment
gwkg
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
Avatar of gwkg
gwkg
Flag of United States of America image

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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of gwkg
gwkg
Flag of United States of America image

Sorry, just realized you were trying to only delete revisions.
SQL
SQL

SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.

61K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo