Actually, I'd be interested to know why the same connection is used for two 
connections to the same database?

I'm guessing people could fall over this trying to do, say, unbuffered 
queries through one to fetch a huge result set, and normal queries through 
another to make changes....

Of course thats not really a good thing to do anyways...

--
Shane

On Tuesday 22 Jan 2002 4:27 pm, Jimmy wrote:
> Hi list,
>
> I do a small test on mysql_connect() and mysql_pconnect(),
> and discover a strange behaviour.
>
> <?
> $cid1 = mysql_pconnect($host,$user,$pass) or die("cant connect1");
> $cid2 = mysql_pconnect($host,$user,$pass) or die("cant connect2");
> echo $cid1, $cid2;
> ?>
>
> the output if using mysql_connect():
> Resource id #1
> Resource id #1
> (both resource id are the same, as expected)
>
> the output if using mysql_pconnect():
> Resource id #1
> Resource id #2
> (both resource id are different)
>
> at first I though pconnect() will create 2 different connection
> because the printed resource id is different.
>
> But after doing some test (by looking at the mysql processlist) i can
> conclude that those two link_identifier are actually the same
> (only one link, but with two different id)
>
> the question is, why pconnect() print different resource id,
> whereas connect() print the same one?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to