ID: 15458
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Bogus
Bug Type: MySQL related
Operating System: Solaris 8
PHP Version: 4.1.1
New Comment:
Thanks for the help and fast reply.
Previous Comments:
------------------------------------------------------------------------
[2002-02-08 17:53:49] [EMAIL PROTECTED]
You've been caught by 'Operator Precedence'.
First, the evaluation of the '||' operator is done. Since you can
successfully connect (and a resource is a logical true), the statement
'opa || opb' gives 'true' then this is assigned to $con.
For what you want to do, you need to set parenthesis properly:
($con = mysql_pconnect($db_Hostname, $db_UserName, $db_Password) ||
die("Can't Connect to Database: ".mysql_error());
------------------------------------------------------------------------
[2002-02-08 17:24:03] [EMAIL PROTECTED]
Sorry forgot to mention, platform is Sparc. And the error also applies
for mysql_connect.
------------------------------------------------------------------------
[2002-02-08 17:22:38] [EMAIL PROTECTED]
$con = mysql_connect($db_Hostname, $db_UserName, $db_Password) ||
die("Can't Connect to Database: ".mysql_error());
print gettype($con);
print $con;
The connection is okay, no error is given. PHP generates an error if
the
username or password is incorrect.
Variable $con supposed to be a link, but instead its a boolean with
the
value true(1). Just for info, other php scripts work fine in
conjuction
with mysql. but for this script I need to have seperate links, instead
of de default last one.
Compile options: --with-mysql
------------------------------------------------------------------------
[2002-02-08 17:19:27] [EMAIL PROTECTED]
$con = mysql_pconnect($db_Hostname, $db_UserName, $db_Password) ||
die("Can't Connect to Database: ".mysql_error());
print gettype($con);
print $con;
The connection is okay, no error is given. PHP generates an error if
the username or password is incorrect.
Variable $con supposed to be a link, but instead its a boolean with the
value true(1). Just for info, other php scripts work fine in conjuction
with mysql. but for this script I need to have seperate links, instead
of de default last one.
Compile options: --with-mysql
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15458&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php