Problem with creating parallel connections with mysql_connect
Problem with creating parallel connections with mysql_connect
am 18.01.2006 10:21:10 von as
--Apple-Mail-3-355080819
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed
Hi List,
decided to try non-permanent connections for now. So now I have:
/* db.php */
$db_server="127.0.0.1";
$db_user = "asterisk";
$db_pass = "bozzo984";
$db_db = "bebbicell";
$db_account_server="127.0.0.1";
$db_account_user = "asterisk";
$db_account_pass = "bozzo984";
$db_account_db = "asterisk";
$allow_multiple = "true";
//$level= error_reporting ( 0);
$bid=mysql_connect($db_server,$db_user,$db_pass, $allow_multiple);
//error_reporting ( $level);
mysql_select_db($db_db,$bid);
//$level= error_reporting ( 0);
$accid=mysql_connect($db_account_server,$db_account_user,
$db_account_pass, $allow_multiple);
//error_reporting ( $level);
mysql_select_db($db_account_db, $accid);
?>
Still I have same error:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link
resource in /var/www/bebbicell.ch/signup.php on line 212
Warning: mysql_error(): supplied argument is not a valid MySQL-Link
resource in /var/www/bebbicell.ch/signup.php on line 213
Offending statements are:
$res = mysql_query($sql,$accid);
$err = mysql_error($accid);
Note that I use php-5.1.2RC1 compiled for Darwin Kernel Version 8.3.0
and Macintosh powerpc
Aarno
--Apple-Mail-3-355080819--
Re: Problem with creating parallel connections with mysql_connect
am 18.01.2006 11:14:53 von robleyd
On Wed, 18 Jan 2006 19:51, Aarno Syvänen wrote:
> Hi List,
>
> decided to try non-permanent connections for now. So now I have:
>
>
>
> /* db.php */
> $db_server=3D"127.0.0.1";
> $db_user =3D "asterisk";
> $db_pass =3D "bozzo984";
> $db_db =3D "bebbicell";
>
> $db_account_server=3D"127.0.0.1";
> $db_account_user =3D "asterisk";
> $db_account_pass =3D "bozzo984";
> $db_account_db =3D "asterisk";
>
> $allow_multiple =3D "true";
>
> //$level=3D error_reporting ( 0);
> $bid=3Dmysql_connect($db_server,$db_user,$db_pass, $allow_multiple);
echo mysql_error();
> //error_reporting ( $level);
> mysql_select_db($db_db,$bid);
echo mysql_error();
>
> //$level=3D error_reporting ( 0);
> $accid=3Dmysql_connect($db_account_server,$db_account_user,
echo mysql_error();
> $db_account_pass, $allow_multiple);
> //error_reporting ( $level);
> mysql_select_db($db_account_db, $accid);
echo mysql_error();
> ?>
>
> Still I have same error:
>
> Warning: mysql_query(): supplied argument is not a valid MySQL-Link
> resource in /var/www/bebbicell.ch/signup.php on line 212
>
> Warning: mysql_error(): supplied argument is not a valid MySQL-Link
> resource in /var/www/bebbicell.ch/signup.php on line 213
>
> Offending statements are:
>
> $res =3D mysql_query($sql,$accid);
echo mysql_error();
> $err =3D mysql_error($accid);
>
> Note that I use php-5.1.2RC1 compiled for Darwin Kernel Version 8.3.0
> and Macintosh powerpc
>
> Aarno
Try the above to find exactly where your problem is
Cheers
=2D-=20
David Robley
If I had anything witty to say, I wouldn't put it here.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Problem with creating parallel connections with mysql_connect
am 18.01.2006 15:30:44 von as
--Apple-Mail-4-373654690
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=ISO-8859-1;
delsp=yes;
format=flowed
I go following debug:
got error <> when doing first connection
resource id was Resource id #3
got error <> when selecting first database
got error <> when doing second connection
resource id was Resource id #4
got error <> when selecting second database
the code was:
$bid=3Dmysql_connect($db_server,$db_user,$db_pass, $allow_multiple);
//error_reporting ( $level);
print "got error <" . mysql_error() . "> when doing first connection\n";
print "resource id was $bid\n";
mysql_select_db($db_db,$bid);
print "got error <" . mysql_error() . "> when selecting first database=20=
\n";
//$level=3D error_reporting ( 0);
$accid=3Dmysql_connect($db_account_server,$db_account_user,= 20
$db_account_pass, $allow_multiple);
print "got error <" . mysql_error() . "> when doing second connection=20
\n";
print "resource id was $accid\n";
//error_reporting ( $level);
mysql_select_db($db_account_db, $accid);
print "got error <" . mysql_error() . "> when selecting second =20
database\n";
So resource ids seem to be proper, and there is no errors either.
Signup.php already tests $err:
$err =3D mysql_error($accid);
if($err=="")
{
echo ("
".lfunc=20
("signup_successful")."
");
}
else
{
echo $err;
}
It branches to $err=="", when at same time reporting
Warning: mysql_error(): supplied argument is not a valid MySQL-Link =20
resource in /var/www/bebbicell.ch/signup.php on line 213
This looks really strange.
Aarno
On 18 Jan 2006, at 11:14, David Robley wrote:
> On Wed, 18 Jan 2006 19:51, Aarno Syvänen wrote:
>> Hi List,
>>
>> decided to try non-permanent connections for now. So now I have:
>>
>>
>>
>> /* db.php */
>> $db_server=3D"127.0.0.1";
>> $db_user =3D "asterisk";
>> $db_pass =3D "bozzo984";
>> $db_db =3D "bebbicell";
>>
>> $db_account_server=3D"127.0.0.1";
>> $db_account_user =3D "asterisk";
>> $db_account_pass =3D "bozzo984";
>> $db_account_db =3D "asterisk";
>>
>> $allow_multiple =3D "true";
>>
>> //$level=3D error_reporting ( 0);
>> $bid=3Dmysql_connect($db_server,$db_user,$db_pass, $allow_multiple);
>
> echo mysql_error();
>
>> //error_reporting ( $level);
>> mysql_select_db($db_db,$bid);
>
> echo mysql_error();
>
>>
>> //$level=3D error_reporting ( 0);
>> $accid=3Dmysql_connect($db_account_server,$db_account_user,
>
> echo mysql_error();
>
>> $db_account_pass, $allow_multiple);
>> //error_reporting ( $level);
>> mysql_select_db($db_account_db, $accid);
>
> echo mysql_error();
>
>> ?>
>>
>> Still I have same error:
>>
>> Warning: mysql_query(): supplied argument is not a valid MySQL-Link
>> resource in /var/www/bebbicell.ch/signup.php on line 212
>>
>> Warning: mysql_error(): supplied argument is not a valid MySQL-Link
>> resource in /var/www/bebbicell.ch/signup.php on line 213
>>
>> Offending statements are:
>>
>> $res =3D mysql_query($sql,$accid);
>
> echo mysql_error();
>
>> $err =3D mysql_error($accid);
>>
>> Note that I use php-5.1.2RC1 compiled for Darwin Kernel Version 8.3.0
>> and Macintosh powerpc
>>
>> Aarno
>
> Try the above to find exactly where your problem is
>
> Cheers
> --=20
> David Robley
>
> If I had anything witty to say, I wouldn't put it here.
>
> --=20
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--Apple-Mail-4-373654690--
Re: Problem with creating parallel connections with mysql_connect
am 18.01.2006 17:24:44 von Bastien Koert
If no connection is made, there is no mysql error. You would need some
custom error message output when the mysql_connect fails...
Bastien
>From: Aarno Syvänen
>To: David Robley
>CC: php-db@lists.php.net
>Subject: Re: [PHP-DB] Problem with creating parallel connections with
>mysql_connect
>Date: Wed, 18 Jan 2006 15:30:44 +0100
>
>I go following debug:
>
>got error <> when doing first connection
>resource id was Resource id #3
>got error <> when selecting first database
>got error <> when doing second connection
>resource id was Resource id #4
>got error <> when selecting second database
>
>the code was:
>
>$bid=mysql_connect($db_server,$db_user,$db_pass, $allow_multiple);
>//error_reporting ( $level);
>print "got error <" . mysql_error() . "> when doing first connection\n";
>print "resource id was $bid\n";
>mysql_select_db($db_db,$bid);
>print "got error <" . mysql_error() . "> when selecting first database \n";
>//$level= error_reporting ( 0);
>$accid=mysql_connect($db_account_server,$db_account_user, $db_account_pass,
>$allow_multiple);
>print "got error <" . mysql_error() . "> when doing second connection \n";
>print "resource id was $accid\n";
>//error_reporting ( $level);
>mysql_select_db($db_account_db, $accid);
>print "got error <" . mysql_error() . "> when selecting second
>database\n";
>
>So resource ids seem to be proper, and there is no errors either.
>
>Signup.php already tests $err:
>
> $err = mysql_error($accid);
> if($err=="")
> {
> echo ("
".lfunc
>("signup_successful")."
");
> }
> else
> {
> echo $err;
> }
>
>It branches to $err=="", when at same time reporting
>Warning: mysql_error(): supplied argument is not a valid MySQL-Link
>resource in /var/www/bebbicell.ch/signup.php on line 213
>
>This looks really strange.
>
>Aarno
>
>On 18 Jan 2006, at 11:14, David Robley wrote:
>
>>On Wed, 18 Jan 2006 19:51, Aarno Syvänen wrote:
>>>Hi List,
>>>
>>>decided to try non-permanent connections for now. So now I have:
>>>
>>>
>>>
>>>/* db.php */
>>>$db_server="127.0.0.1";
>>>$db_user = "asterisk";
>>>$db_pass = "bozzo984";
>>>$db_db = "bebbicell";
>>>
>>>$db_account_server="127.0.0.1";
>>>$db_account_user = "asterisk";
>>>$db_account_pass = "bozzo984";
>>>$db_account_db = "asterisk";
>>>
>>>$allow_multiple = "true";
>>>
>>>//$level= error_reporting ( 0);
>>>$bid=mysql_connect($db_server,$db_user,$db_pass, $allow_multiple);
>>
>>echo mysql_error();
>>
>>>//error_reporting ( $level);
>>>mysql_select_db($db_db,$bid);
>>
>>echo mysql_error();
>>
>>>
>>>//$level= error_reporting ( 0);
>>>$accid=mysql_connect($db_account_server,$db_account_user,
>>
>>echo mysql_error();
>>
>>>$db_account_pass, $allow_multiple);
>>>//error_reporting ( $level);
>>>mysql_select_db($db_account_db, $accid);
>>
>>echo mysql_error();
>>
>>>?>
>>>
>>>Still I have same error:
>>>
>>>Warning: mysql_query(): supplied argument is not a valid MySQL-Link
>>>resource in /var/www/bebbicell.ch/signup.php on line 212
>>>
>>>Warning: mysql_error(): supplied argument is not a valid MySQL-Link
>>>resource in /var/www/bebbicell.ch/signup.php on line 213
>>>
>>>Offending statements are:
>>>
>>>$res = mysql_query($sql,$accid);
>>
>>echo mysql_error();
>>
>>> $err = mysql_error($accid);
>>>
>>>Note that I use php-5.1.2RC1 compiled for Darwin Kernel Version 8.3.0
>>>and Macintosh powerpc
>>>
>>>Aarno
>>
>>Try the above to find exactly where your problem is
>>
>>Cheers
>>--
>>David Robley
>>
>>If I had anything witty to say, I wouldn't put it here.
>>
>>--
>>PHP Database Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php