I’m being asked if I can fetch the result from 18 different WordPress databases merged into one database with conflicting names, filter them, and then play with the results in PHP.
For example:
I have data (posts) in ara_posts, val_posts, and car_posts (all of them are tables that have post_name, post_type, post_status and post_date in their column names). I want to select all the data from those tables and filter the result (only show results that have post_type = ‘post’).
What I want to do with the result is compare the dates and fetch the latest 3 posts from all those 18 tables, that have their status to “publish” and the post type “post”.
How is that possible?
As proposed in an answer to this question quite similar to yours, you can probably use the UNION operator. Something like this: