Z
Z
zxcursed2021-07-13 18:09:59
PHP
zxcursed, 2021-07-13 18:09:59

How to work with multiple databases?

Good afternoon, there are several databases on different servers, each one stores different information, depending on the request to the server, you need to take data from a specific database, how to build a "construction" or the like in order to work with them optimally?
(do not create the same for each connection each time the script is executed)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2021-07-13
@Stalker_RED

Connect to the right databases when needed, not every time.

N
Nikita Zelikov, 2021-07-14
@gzmone

The answer to the question is very simple, create different database connections with different variables in a separate file...
Connect via request and use the required database connection if necessary.
Naturally, do not forget about security, as the great minds of socialism bequeathed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question