strange behaviour of mysql_pconnect()
| From: | Jimmy | Date: | Tue, 22 Jan 2002 16:27:44 +0000 |
| Subject: | strange behaviour of mysql_pconnect() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-81568@lists.php.net to get a copy of this message | ||
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?
--
Jimmy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can't quicken the growing of a plant by pulling the leaves