PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Aug 17, 2018 5:02 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon May 22, 2017 6:12 pm 
Offline
Forum Contributor

Joined: Fri Jul 20, 2007 11:29 am
Posts: 365
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?

_________________
Warning: I have no idea what I'm talking about.


Top
 Profile  
 
PostPosted: Tue May 23, 2017 2:08 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6617
Location: WA, USA
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group