Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,650 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,159 people online right now. Registration is fast and FREE... Join Now!




'mysql_pconnect'ing multiple links

 
Reply to this topicStart new topic

'mysql_pconnect'ing multiple links, Is this possible?

jbeall
post 28 Nov, 2002 - 07:26 PM
Post #1


New D.I.C Head

*
Joined: 1 Oct, 2002
Posts: 42

Hi all,

I have a question that I think I already know the answer too, but thought I'd inquire to see if anybody else knew something I didn't. It wouldn't be the first time... blink.gif

I want to use mysql_pconnect to set up two links, to the same MySQL server - these links need to be separate, and will be pointed at different databases. Depending on the site, they may or may not be using the same MySQL user, too. The environment I want to set up needs to be able to handle both conditions.

The problem is that when I do something like:

$dbLink = mysql_pconnect ("localhost", "user", "password")
$dbLink2 = mysql_pconnect ("localhost", "user", "password")

They are both really the same link. I wind up with one link with two names. The only way I can see to fix this is to set up two MySQL users, or use mysql_connect. Question, however - anyone have any idea what the performance difference is between using persistent and "normal" connections? If it's negligable, I might as well just use mysql_connect with the "new link" boolean parameter set.
User is offlineProfile CardPM

Go to the top of the page

skrilla
post 29 Nov, 2002 - 05:11 AM
Post #2


boots.

*****
Joined: 5 Jul, 2002
Posts: 2,848



Dream Kudos: 14
My Contributions


personally, i use mysql_connect() for morobo and my SQL powered sites. i find it to be just fine, and i suspect that you will, too. if you need to have the two different links, try this out, see if it's gonna work out for ya. that's about all that i can tell ya right about now smile.gif

-pete pirate.gif
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 05:14AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month