Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

prakashbhatnager@gmail.com's avatar

persist database connection for rest api

I want to connect the first database on first rest api request and at the same time i am able to make the second database connection, And so for each new remaining requests i want to connect on second database only without connection to first database.

So i am thinking to serialize the db connection and send it, any one did the same please suggest. How can i achieve it.

0 likes
0 replies

Please or to participate in this conversation.