[phplib] db_mysql.inc omits "@" on connect call From: rmroczk <email protected>
Date: 08/14/00

I'm using phplib-7.2b and encountered a problem due to the omission
of the error suppression operator before the connect call.

This looks like a problem in 7.2c as well.

The problem is that the mysql connect error message is sent in addition
to the one generated by the halt method for the DB_sql class.

I have overridden the halt
method since the context that the php code runs in on the page is a
javascript url. My overridden halt method ensures that the javascript
context is maintained but since a connect error is slipping through the
message causes a javascript error and the page does not display and the
user does not see any error message.

Here is my change to this file with my notes. Feel free to modify
and incorporate this code into this file if you'd like.

Bob Mroczka

    73 //rmroczk 8/14/00 added "@" before connect call below
    74 //since two error messages get sent to browser if
    75 //connect fails. also added $php_errormsg to halt argument;
    76 //note that php "track errors" config variable must be on
    77 $this->Link_ID= <email protected>($Host, $User, $Password);
    78 if (!$this->Link_ID) {
    79 //$this->halt($GLOBAL["php_errormsg"]."; pconnect($Host, $User, \$Password) failed.");
    80 $this->halt($php_errormsg."; pconnect($Host, $User, \$Password) failed.");
    81 return 0;
    82 }
    83

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>