最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Communication in between WordPress database and another (not WordPress) database

matteradmin9PV0评论

I have a WordPress site running and I am making a data entry portal for our data entry operators to speed up their work (we need data entry portal to make sure we don't have duplicate entries). I have two databases one of WordPress and other one of data-entry-portal. I want to make some communication in between two, so any changes in any one DB reflects in other too. Can't use stored procedures and triggers due to structural difference in both databases. any other ideas on it?

I have a WordPress site running and I am making a data entry portal for our data entry operators to speed up their work (we need data entry portal to make sure we don't have duplicate entries). I have two databases one of WordPress and other one of data-entry-portal. I want to make some communication in between two, so any changes in any one DB reflects in other too. Can't use stored procedures and triggers due to structural difference in both databases. any other ideas on it?

Share Improve this question asked Mar 20, 2019 at 5:39 Hira AnwerHira Anwer 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

Two ways:
1. use the federated engine to enable one Mysql server to talk to the other;
2. have WordPress talk to both. Create a second wpdb object that talks to the non-WordPress database. This is quite possible, and you can give it non-WordPress-related queries. See Using wpdb to connect to a separate database for more.

The fly in the ointment is transactions. Actually, out-of-the-box WordPress doesn't even do transactions at all. That's a bigger issue with multiple servers. How to do that right would be good question by itself.

Post a comment

comment list (0)

  1. No comments so far