I'm very slowly updating a legacy project to be php7 compliant.
There are many raw mysql_query calls, and functions that contain mysql_query, and primative poorly written models that use both.
I want to switch to either raw PDO or something like https://github.com/colshrapnel/safemysql or a stand-alone version of Laravel's Eloquent but I won't be able to update every part of the project all at once. This means most views will do both the original mysql_connect and the connection for the new library.
Are there any drawbacks or problems that arise from making 2 db connections in the same script?
Are there any drawbacks to having multiple db connections?
Moderator: General Moderators
-
thinsoldier
- Forum Contributor
- Posts: 367
- Joined: Fri Jul 20, 2007 11:29 am
- Contact:
Are there any drawbacks to having multiple db connections?
Warning: I have no idea what I'm talking about.
Re: Are there any drawbacks to having multiple db connection
Well, it will double the number of connections open to your database, meaning you'll exhaust that resource twice as fast. Some things like transactions and temporary tables don't work across connections.
Don't rush the upgrade. Do it as you can, test, and release when it's ready.
Don't rush the upgrade. Do it as you can, test, and release when it's ready.