Re: mysql_pconnect cannot create two permanent connections to the same machine ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 17 January 2006 7:57 am, Aarno Syvänen wrote:
> Hi List,
>
> I do not claim that this is bug, but it is not a nice feature either.
>
> I do have following:
>
> <?
> /* db.php */
> $db_server="127.0.0.1";
> $db_user = ******
> $db_pass = ******
> $db_db = "bebbicell";
>
> $db_account_server="127.0.0.1";
> $db_account_user = ********
> $db_account_pass = ********
> $db_account_db = "asterisk";
>
> //$level= error_reporting ( 0);
> $bid=mysql_pconnect($db_server,$db_user,$db_pass);
> //error_reporting ( $level);
> mysql_select_db($db_db,$bid);
>
> //$level= error_reporting ( 0);
> $accid=mysql_pconnect($db_account_server,$db_account_user,
> $db_account_pass);
> //error_reporting ( $level);
> mysql_select_db($db_account_db, $accid);
> ?>
>
> Note that databases here are totally unrelated. They are on the same
> machine only
> because i am developing. I want later to move  'asterisk' to a
> separate machine, but
> when i do this, i want just change $db*s, not any other code. Because
> on this, i want
> both $bid and $accid to be valid handles.
>
> Currently it is not so. Both
>
> $res = mysql_query($sql,$accid);
> $err = mysql_error($accid);
>
> will generate error
>
> Warning: mysql_query(): supplied argument is not a valid MySQL-Link
> resource in /var/www/bebbicell.ch/signup.php
>
> And yes, there are no functions in signup.php.
>
> Aarno

If you remove the $bid connection code, (comment it out) does your test code 
with $accid work? 

-Micah 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux