irm-1.6-b3/MDB/fbsql.php
/**
     * Connect to the database
     *
     * @return TRUE on success, MDB_Error on failure
     **/
Connect to the database
@return TRUE on success, MDB_Error on failure
Connect to the database @return TRUE on success MDB_Error on failure
function connect()
    {
        $port = (isset($this->port) ? $this->port : 0);
        if($this->connection != 0) {
            if (!strcmp($this->connected_host, $this->host)
                && !strcmp($this->connected_user, $this->user)
                && !strcmp($this->connected_password, $this->password)
                && !strcmp($this->connected_port, $port)
                && $this->opened_persistent == $this->options['persistent'])
            {
                return(MDB_OK);
            }
            @fbsql_close($this->connection);
            $this->connection = 0;
            $this->affected_rows = -1;
        }
        if(!PEAR::loadExtension($this->phptype)) {
            return(PEAR::raiseError(NULL, MDB_ERROR_NOT_FOUND,
                NULL, NULL, 'extension '.$this->phptype.' is not compiled into PHP',
                'MDB_Error', TRUE));
        }
        $function = ($this->options['persistent'] ? 'fbsql_pconnect' : 'fbsql_connect');
        if(!function_exists($function)) {
            return($this->raiseError(MDB_ERROR_UNSUPPORTED));
        }
        @ini_set('track_errors', TRUE);
        $this->connection = @$function(
            $port > 0 ? $port : $this->host,
            $this->user, $this->password);
        @ini_restore('track_errors');
        if ($this->connection <= 0) {
            return($this->raiseError(MDB_ERROR_CONNECT_FAILED, NULL, NULL,
                $php_errormsg));
        }
        if (isset($this->supported['Transactions']) && !$this->auto_commit) {
            if (!@fbsql_query('SET AUTOCOMMIT FALSE;', $this->connection)) {
                @fbsql_close($this->connection);
                $this->connection = 0;
                $this->affected_rows = -1;
                return($this->raiseError());
            }
            $this->in_transaction = TRUE;
        }
        $this->connected_host = $this->host;
        $this->connected_user = $this->user;
        $this->connected_password = $this->password;
        $this->connected_port = $port;
        $this->opened_persistent = $this->options['persistent'];
        return(MDB_OK);
    }
function connect ( ) { $ port = ( isset ( $ this -> port ) ? $ this -> port : 0 ) ; if ( $ this -> connection != 0 ) { if ( ! strcmp ( $ this -> connected_host , $ this -> host ) && ! strcmp ( $ this -> connected_user , $ this -> user ) && ! strcmp ( $ this -> connected_password , $ this -> password ) && ! strcmp ( $ this -> connected_port , $ port ) && $ this -> opened_persistent == $ this -> options [ 'persistent' ] ) { return ( MDB_OK ) ; } @ fbsql_close ( $ this -> connection ) ; $ this -> connection = 0 ; $ this -> affected_rows = - 1 ; } if ( ! PEAR :: loadExtension ( $ this -> phptype ) ) { return ( PEAR :: raiseError ( NULL , MDB_ERROR_NOT_FOUND , NULL , NULL , 'extension ' . $ this -> phptype . ' is not compiled into PHP' , 'MDB_Error' , TRUE ) ) ; } $ function = ( $ this -> options [ 'persistent' ] ? 'fbsql_pconnect' : 'fbsql_connect' ) ; if ( ! function_exists ( $ function ) ) { return ( $ this -> raiseError ( MDB_ERROR_UNSUPPORTED ) ) ; } @ ini_set ( 'track_errors' , TRUE ) ; $ this -> connection = @ $ function ( $ port > 0 ? $ port : $ this -> host , $ this -> user , $ this -> password ) ; @ ini_restore ( 'track_errors' ) ; if ( $ this -> connection <= 0 ) { return ( $ this -> raiseError ( MDB_ERROR_CONNECT_FAILED , NULL , NULL , $ php_errormsg ) ) ; } if ( isset ( $ this -> supported [ 'Transactions' ] ) && ! $ this -> auto_commit ) { if ( ! @ fbsql_query ( 'SET AUTOCOMMIT FALSE;' , $ this -> connection ) ) { @ fbsql_close ( $ this -> connection ) ; $ this -> connection = 0 ; $ this -> affected_rows = - 1 ; return ( $ this -> raiseError ( ) ) ; } $ this -> in_transaction = TRUE ; } $ this -> connected_host = $ this -> host ; $ this -> connected_user = $ this -> user ; $ this -> connected_password = $ this -> password ; $ this -> connected_port = $ port ; $ this -> opened_persistent = $ this -> options [ 'persistent' ] ; return ( MDB_OK ) ; }
Connect to the database
 @return TRUE on success, MDB_Error on failure
Connect to the database @return TRUE on success MDB_Error on failure