• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ibase_pconnect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ibase_pconnect函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_pconnect函数的具体用法?PHP ibase_pconnect怎么用?PHP ibase_pconnect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ibase_pconnect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: connect

 public function connect($config = array())
 {
     $this->config = $config;
     $this->connect = $this->config['pconnect'] === true ? @ibase_pconnect($this->config['host'] . ':' . $this->config['database'], $this->config['user'], $this->config['password'], $this->config['charset']) : @ibase_connect($this->config['host'] . ':' . $this->config['database'], $this->config['user'], $this->config['password'], $this->config['charset']);
     if (empty($this->connect)) {
         die(getErrorMessage('Database', 'mysqlConnectError'));
     }
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:8,代码来源:Ibase.php


示例2: sql_connect

 function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false)
 {
     $this->persistency = $persistency;
     $this->user = $sqluser;
     $this->server = $sqlserver . ($port ? ':' . $port : '');
     $this->dbname = $database;
     $this->db_connect_id = $this->persistency ? @ibase_pconnect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3);
     return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
 }
开发者ID:MarxGonzalez,项目名称:SemanticScuttle,代码行数:9,代码来源:firebird.php


示例3: connect

 protected function connect()
 {
     if ($this->lnk === null) {
         $this->lnk = $this->settings->persist ? @\ibase_pconnect($this->settings->servername . $this->settings->database, $this->settings->username, $this->settings->password, strtoupper($this->settings->charset)) : @\ibase_connect($this->settings->servername . $this->settings->database, $this->settings->username, $this->settings->password, strtoupper($this->settings->charset));
         if ($this->lnk === false) {
             throw new DatabaseException('Connect error: ' . \ibase_errmsg());
         }
     }
 }
开发者ID:vakata,项目名称:database,代码行数:9,代码来源:Ibase.php


示例4: sql_connect

 /**
  * Connect to server
  */
 function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
 {
     $this->persistency = $persistency;
     $this->user = $sqluser;
     $this->server = $sqlserver . ($port ? ':' . $port : '');
     $this->dbname = $database;
     $this->db_connect_id = $this->persistency ? @ibase_pconnect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3);
     $this->service_handle = function_exists('ibase_service_attach') ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false;
     return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
 }
开发者ID:jambik,项目名称:elenaburgon,代码行数:13,代码来源:firebird.php


示例5: dbConnect

/** Métodos de Conexión y Consulta a la BD
*
*/
function dbConnect()
{
    //C:\Archivos de programa\Archivos comunes\Aspel\Sistemas Aspel\CAJA3.50\Datos
    $DB = "C:\\Archivos de programa\\Archivos comunes\\Aspel\\Sistemas Aspel\\CAJA3.50\\Ejemplos\\Ejemplos.FDB";
    //Voy a utilizar el login y el password que trae Interbase por defecto.
    $User = "sysdba";
    $Pass = "masterkey";
    //"Prueba de conexión a la bd";
    $cxn = ibase_pconnect($DB, $User, $Pass) or die("Error al conectarse a la base de datos");
    return $cxn;
}
开发者ID:BitmovilOpenS,项目名称:ConsultaInventario,代码行数:14,代码来源:dbConnection.php


示例6: connect

 /**
  * @see ILumine_Connection::connect()
  */
 public function connect()
 {
     if ($this->conn_id && $this->state == self::OPEN) {
         Lumine_Log::debug('Utilizando conexao cacheada com ' . $this->getDatabase());
         return true;
     }
     $this->dispatchEvent(new Lumine_ConnectionEvent(Lumine_Event::PRE_CONNECT, $this));
     $hostString = $this->getHost();
     if ($this->getPort() != '') {
         // nao colocamos a porta uma vez que a string de conexao
         // nao suporta a informacao da porta
         //$hostString .=  ':' . $this->getPort();
     }
     $hostString = empty($hostString) ? $this->getDatabase() : $hostString . ':' . $this->getDatabase();
     if (isset($this->options['socket']) && $this->options['socket'] != '') {
         $hostString .= ':' . $this->options['socket'];
     }
     $flags = isset($this->options['flags']) ? $this->options['flags'] : null;
     if (isset($this->options['persistent']) && $this->options['persistent'] == true) {
         Lumine_Log::debug('Criando conexao persistente com ' . $this->getDatabase());
         $this->conn_id = @ibase_pconnect($hostString, $this->getUser(), $this->getPassword());
     } else {
         Lumine_Log::debug('Criando conexao com ' . $this->getDatabase());
         $this->conn_id = @ibase_connect($hostString, $this->getUser(), $this->getPassword());
     }
     if (!$this->conn_id) {
         $this->state = self::CLOSED;
         $msg = 'Nao foi possivel conectar no banco de dados: ' . $this->getDatabase() . ' - ' . $this->getErrorMsg();
         Lumine_Log::error($msg);
         $this->dispatchEvent(new Lumine_ConnectionEvent(Lumine_Event::CONNECTION_ERROR, $this, $msg));
         throw new Exception($msg);
         return false;
     }
     if (function_exists('ibase_timefmt')) {
         ibase_timefmt($this->ibase_datefmt, IBASE_DATE);
         if ($this->dialect == 1) {
             ibase_timefmt($this->ibase_datefmt, IBASE_TIMESTAMP);
         } else {
             ibase_timefmt($this->ibase_timestampfmt, IBASE_TIMESTAMP);
         }
         ibase_timefmt($this->ibase_timefmt, IBASE_TIME);
     } else {
         ini_set("ibase.timestampformat", $this->ibase_timestampfmt);
         ini_set("ibase.dateformat", $this->ibase_datefmt);
         ini_set("ibase.timeformat", $this->ibase_timefmt);
     }
     $this->state = self::OPEN;
     $this->dispatchEvent(new Lumine_ConnectionEvent(Lumine_Event::POS_CONNECT, $this));
     $this->setCharset($this->getCharset());
     return true;
 }
开发者ID:rrmoura1,项目名称:Abstergo,代码行数:54,代码来源:Firebird.php


示例7: dbQuery

function dbQuery($query, $show_errors = true, $all_results = true, $show_output = true)
{
    if ($show_errors) {
        error_reporting(E_ALL);
    } else {
        error_reporting(E_PARSE);
    }
    // Connect to the Firebird/Interbase Sybase database management system
    $link = ibase_pconnect("/var/www/sqlmap/dbs/firebird/testdb.fdb", "SYSDBA", "testpass");
    if (!$link) {
        die(ibase_errmsg());
    }
    // Print results in HTML
    print "<html><body>\n";
    // Print SQL query to test sqlmap '--string' command line option
    //print "<b>SQL query:</b> " . $query . "<br>\n";
    // Perform SQL injection affected query
    $result = ibase_query($link, $query);
    if (!$result) {
        if ($show_errors) {
            print "<b>SQL error:</b> " . ibase_errmsg() . "<br>\n";
        }
        exit(1);
    }
    print "<b>SQL results:</b>\n";
    print "<table border=\"1\">\n";
    while ($line = ibase_fetch_assoc($result)) {
        // This must stay here for Firebird
        if (!$show_output) {
            exit(1);
        }
        print "<tr>";
        foreach ($line as $col_value) {
            print "<td>" . $col_value . "</td>";
        }
        print "</tr>\n";
        if (!$all_results) {
            break;
        }
    }
    print "</table>\n";
    print "</body></html>";
}
开发者ID:dieface,项目名称:testenv,代码行数:43,代码来源:firebird.inc.php


示例8: connect

 /**
  * Connects to a database.
  * @return void
  * @throws Dibi\Exception
  */
 public function connect(array &$config)
 {
     Dibi\Helpers::alias($config, 'database', 'db');
     if (isset($config['resource'])) {
         $this->connection = $config['resource'];
     } else {
         // default values
         $config += ['username' => ini_get('ibase.default_password'), 'password' => ini_get('ibase.default_user'), 'database' => ini_get('ibase.default_db'), 'charset' => ini_get('ibase.default_charset'), 'buffers' => 0];
         if (empty($config['persistent'])) {
             $this->connection = @ibase_connect($config['database'], $config['username'], $config['password'], $config['charset'], $config['buffers']);
             // intentionally @
         } else {
             $this->connection = @ibase_pconnect($config['database'], $config['username'], $config['password'], $config['charset'], $config['buffers']);
             // intentionally @
         }
         if (!is_resource($this->connection)) {
             throw new Dibi\DriverException(ibase_errmsg(), ibase_errcode());
         }
     }
 }
开发者ID:dg,项目名称:dibi,代码行数:25,代码来源:FirebirdDriver.php


示例9: sql_connect

 /**
  * Connect to server
  */
 function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
 {
     $this->persistency = $persistency;
     $this->user = $sqluser;
     $this->server = $sqlserver . ($port ? ':' . $port : '');
     $this->dbname = str_replace('\\', '/', $database);
     // There are three possibilities to connect to an interbase db
     if (!$this->server) {
         $use_database = $this->dbname;
     } else {
         if (strpos($this->server, '//') === 0) {
             $use_database = $this->server . $this->dbname;
         } else {
             $use_database = $this->server . ':' . $this->dbname;
         }
     }
     $this->db_connect_id = $this->persistency ? @ibase_pconnect($use_database, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3);
     $this->service_handle = function_exists('ibase_service_attach') && $this->server ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false;
     return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
 }
开发者ID:BACKUPLIB,项目名称:mwenhanced,代码行数:23,代码来源:firebird.php


示例10: connect

 /**
  * Connect
  *
  * @param   bool reconnect default FALSE
  * @return  bool success
  * @throws  rdbms.SQLConnectException
  */
 public function connect($reconnect = FALSE)
 {
     if (is_resource($this->handle)) {
         return TRUE;
     }
     // Already connected
     if (!$reconnect && FALSE === $this->handle) {
         return FALSE;
     }
     // Previously failed connecting
     $db = $this->dsn->getHost() . ':' . $this->dsn->getDatabase();
     if ($this->flags & DB_PERSISTENT) {
         $this->handle = ibase_pconnect($db, $this->dsn->getUser(), $this->dsn->getPassword(), 'ISO8859_1');
     } else {
         $this->handle = ibase_connect($db, $this->dsn->getUser(), $this->dsn->getPassword(), 'ISO8859_1');
     }
     if (!is_resource($this->handle)) {
         throw new SQLConnectException(trim(ibase_errmsg()), $this->dsn);
     }
     $this->_obs && $this->notifyObservers(new DBEvent(__FUNCTION__, $reconnect));
     return TRUE;
 }
开发者ID:Gamepay,项目名称:xp-framework,代码行数:29,代码来源:InterBaseConnection.class.php


示例11: connect

 /**
  * Connects to a database.
  * @return void
  * @throws DibiException
  */
 public function connect(array &$config)
 {
     DibiConnection::alias($config, 'database', 'db');
     if (isset($config['resource'])) {
         $this->connection = $config['resource'];
     } else {
         // default values
         if (!isset($config['username'])) {
             $config['username'] = ini_get('ibase.default_password');
         }
         if (!isset($config['password'])) {
             $config['password'] = ini_get('ibase.default_user');
         }
         if (!isset($config['database'])) {
             $config['database'] = ini_get('ibase.default_db');
         }
         if (!isset($config['charset'])) {
             $config['charset'] = ini_get('ibase.default_charset');
         }
         if (!isset($config['buffers'])) {
             $config['buffers'] = 0;
         }
         DibiDriverException::tryError();
         if (empty($config['persistent'])) {
             $this->connection = ibase_connect($config['database'], $config['username'], $config['password'], $config['charset'], $config['buffers']);
             // intentionally @
         } else {
             $this->connection = ibase_pconnect($config['database'], $config['username'], $config['password'], $config['charset'], $config['buffers']);
             // intentionally @
         }
         if (DibiDriverException::catchError($msg)) {
             throw new DibiDriverException($msg, ibase_errcode());
         }
         if (!is_resource($this->connection)) {
             throw new DibiDriverException(ibase_errmsg(), ibase_errcode());
         }
     }
 }
开发者ID:vrana,项目名称:dibi,代码行数:43,代码来源:firebird.php


示例12: sql_connect

 /**
  * Connect to server
  */
 function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
 {
     $this->persistency = $persistency;
     $this->user = $sqluser;
     $this->server = $sqlserver . ($port ? ':' . $port : '');
     $this->dbname = str_replace('\\', '/', $database);
     // There are three possibilities to connect to an interbase db
     if (!$this->server) {
         $use_database = $this->dbname;
     } else {
         if (strpos($this->server, '//') === 0) {
             $use_database = $this->server . $this->dbname;
         } else {
             $use_database = $this->server . ':' . $this->dbname;
         }
     }
     if ($this->persistency) {
         if (!function_exists('ibase_pconnect')) {
             $this->connect_error = 'ibase_pconnect function does not exist, is interbase extension installed?';
             return $this->sql_error('');
         }
         $this->db_connect_id = @ibase_pconnect($use_database, $this->user, $sqlpassword, false, false, 3);
     } else {
         if (!function_exists('ibase_connect')) {
             $this->connect_error = 'ibase_connect function does not exist, is interbase extension installed?';
             return $this->sql_error('');
         }
         $this->db_connect_id = @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3);
     }
     // Do not call ibase_service_attach if connection failed,
     // otherwise error message from ibase_(p)connect call will be clobbered.
     if ($this->db_connect_id && function_exists('ibase_service_attach') && $this->server) {
         $this->service_handle = @ibase_service_attach($this->server, $this->user, $sqlpassword);
     } else {
         $this->service_handle = false;
     }
     return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
 }
开发者ID:ahmatjan,项目名称:Crimson,代码行数:41,代码来源:firebird.php


示例13: Connect

 function Connect()
 {
     if (!$this->intConn) {
         if ($this->intDebug) {
             echo "Establishing connection...\t\t\n";
         }
         if ($this->intUsePersistent) {
             $this->intConn = @ibase_pconnect($this->strHost . ':' . $this->strDatabase, $this->strUser, $this->strPassword) or die("Error:" . ibase_errmsg() . "<br>\n");
         } else {
             $this->intConn = @ibase_connect($this->strHost . ':' . $this->strDatabase, $this->strUser, $this->strPassword) or die("Error:" . ibase_errmsg() . "<br>\n");
         }
     }
     if (!$this->intConn) {
         if ($this->intDebug) {
             echo "Error establishing connection!\n";
         }
     } else {
         if ($this->intDebug) {
             echo "Connection established!<br>";
         }
     }
     return $this->intConn;
 }
开发者ID:ibnoe,项目名称:simpatda-thinkfrogs,代码行数:23,代码来源:metafire.lib.php


示例14: connect

 /**
  * Connect
  *
  * @param   bool reconnect default FALSE
  * @return  bool success
  * @throws  rdbms.SQLConnectException
  */
 public function connect($reconnect = false)
 {
     if (is_resource($this->handle)) {
         return true;
     }
     // Already connected
     if (!$reconnect && false === $this->handle) {
         return false;
     }
     // Previously failed connecting
     $this->_obs && $this->notifyObservers(new \rdbms\DBEvent(\rdbms\DBEvent::CONNECT, $reconnect));
     $db = $this->dsn->getHost() . ':' . $this->dsn->getDatabase();
     if ($this->flags & DB_PERSISTENT) {
         $this->handle = ibase_pconnect($db, $this->dsn->getUser(), $this->dsn->getPassword(), 'UTF_8');
     } else {
         $this->handle = ibase_connect($db, $this->dsn->getUser(), $this->dsn->getPassword(), 'UTF_8');
     }
     if (!is_resource($this->handle)) {
         throw new \rdbms\SQLConnectException(trim(ibase_errmsg()), $this->dsn);
     }
     $this->_obs && $this->notifyObservers(new \rdbms\DBEvent(\rdbms\DBEvent::CONNECTED, $reconnect));
     return true;
 }
开发者ID:xp-framework,项目名称:rdbms,代码行数:30,代码来源:InterBaseConnection.class.php


示例15: gcms_pconnect

function gcms_pconnect($server, $user, $password, $database)
{
    global $fbdb;
    $fbdb = ibase_pconnect("{$server}:{$database}", $user, $password, '', 0, 3);
    return $fbdb;
}
开发者ID:ibnoe,项目名称:simpatda-thinkfrogs,代码行数:6,代码来源:firebird.php


示例16: db_pconnect

 /**
  * Persistent database connection
  *
  * @return	resource
  */
 public function db_pconnect()
 {
     return @ibase_pconnect($this->hostname . ':' . $this->database, $this->username, $this->password, $this->char_set);
 }
开发者ID:colonia,项目名称:tomatocart-v2,代码行数:9,代码来源:interbase_driver.php


示例17: _pconnect

 function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
 {
     if ($this->charSet) {
         $this->_connectionID = ibase_pconnect($argHostname, $argUsername, $argPassword, $this->charSet);
     } else {
         $this->_connectionID = ibase_pconnect($argHostname, $argUsername, $argPassword);
     }
     if ($this->_connectionID === false) {
         $this->_handleerror();
         return false;
     }
     return true;
 }
开发者ID:qoire,项目名称:portal,代码行数:13,代码来源:adodb-ibase.inc.php


示例18: connect

 public function connect()
 {
     $this->lnk = $this->settings->persist ? @ibase_pconnect($this->settings->servername . $this->settings->database, $this->settings->username, $this->settings->password, strtoupper($this->settings->charset)) : @ibase_connect($this->settings->servername . $this->settings->database, $this->settings->username, $this->settings->password, strtoupper($this->settings->charset));
     if ($this->lnk === false) {
         throw new Exception('Connect error: ' . ibase_errmsg());
     }
     return true;
 }
开发者ID:roychoo,项目名称:jstree,代码行数:8,代码来源:class.db.php


示例19: pconnect

 function pconnect()
 {
     $this->error = "";
     //Set the errors to none
     if ($this->debug) {
         $this->debugmsg("Connecting (PConnect) to " . $this->dbtype . " database....", "blue");
     }
     switch ($this->dbtype) {
         /* Firebird Functionality */
         case "firebird":
             ini_set("ibase.dateformat", $this->dateformat);
             ini_set("ibase.timestampformat", $this->datetimeformat);
             $this->dbh = ibase_pconnect($this->dbpath, $this->username, $this->password);
             break;
             /* SQLite Functionality */
         /* SQLite Functionality */
         case "sqlite":
             define("CDE_ASSOC", SQLITE_ASSOC);
             define("CDE_NUM", SQLITE_NUM);
             define("CDE_BOTH", SQLITE_BOTH);
             putenv("TMP=" . $this->tmppath);
             $this->dbh = sqlite_open($this->dbpath);
             break;
             /* DBASE Functionality */
         /* DBASE Functionality */
         case "dbase":
             $this->dbh = dbase_open($this->dbpath, 2);
             break;
             /* MYSQL Functionality */
         /* MYSQL Functionality */
         case "mysql":
             $connection = explode(":", $this->dbpath);
             $this->dbh = mysql_connect($connection[0], $this->username, $this->password);
             mysql_select_db($connection[1]);
             break;
             /* Oracle Functionality */
         /* Oracle Functionality */
         case "oracle":
             $this->dbh = oci_pconnect($this->username, $this->password, $this->dbpath);
             break;
             /* MSSQL Functionality */
         /* MSSQL Functionality */
         case "mssql":
             define("CDE_ASSOC", MSSQL_ASSOC, true);
             define("CDE_NUM", MSSQL_NUM, true);
             define("CDE_BOTH", MSSQL_BOTH, true);
             $connection = explode(":", $this->dbpath);
             $this->dbh = mssql_connect($connection[0], $this->username, $this->password);
             mssql_select_db($connection[1]);
             break;
             /* PGSQL Functionality */
         /* PGSQL Functionality */
         case "pgsql":
             $connection = explode(":", $this->dbpath);
             $this->dbh = pg_connect("host=" . $connection[0] . " dbname=" . $connection[1] . " user=" . $this->username . " pass=" . $this->password . "");
             break;
     }
     //Define defaults for all databases that don't suport fetch_array
     define("CDE_ASSOC", 1);
     define("CDE_NUM", 2);
     define("CDE_BOTH", 3);
     define("CDE_INSERT", 0);
     define("CDE_UPDATE", 1);
     define("CDE_DELETE", 2);
     if ($this->debug) {
         if ($this->dbh) {
             $this->debugmsg("Connected (pconnect) to " . $this->dbtype . " database....", "green");
         } else {
             $this->debugmsg("Failed to connect (pconnect) " . $this->dbtype . " database....", "red");
             exit;
         }
         //if we can't connect don't go on.
     }
 }
开发者ID:mortalerror,项目名称:ultimatesims,代码行数:74,代码来源:cdeclass.php


示例20: dbi_connect

function dbi_connect($host, $login, $password, $database, $lazy = true)
{
    global $db_cache_count, $db_connection_info, $db_query_count, $old_textlimit, $old_textsize, $db_sqlite_error_str;
    $db_cache_count = $db_query_count = 0;
    if (!isset($db_connection_info)) {
        $db_connection_info = array();
    }
    $db_connection_info['connected'] = false;
    $db_connection_info['connection'] = 0;
    $db_connection_info['database'] = $database;
    $db_connection_info['host'] = $host;
    $db_connection_info['login'] = $login;
    $db_connection_info['password'] = $password;
    // mysqli requires $db_connection_info['connection'] to be set
    if (strcmp($GLOBALS['db_type'], 'mysqli') == 0) {
        $lazy == false;
    }
    // Lazy connections... do not connect until 1st call to dbi_query.
    if ($lazy) {
        // echo "<!-- Waiting on db connection made (lazy) -->\nRETURN!<br />";
        return true;
    }
    if (strcmp($GLOBALS['db_type'], 'mysql') == 0) {
        $c = $GLOBALS['db_persistent'] ? mysql_pconnect($host, $login, $password) : mysql_connect($host, $login, $password);
        if ($c) {
            if (!mysql_select_db($database)) {
                return false;
            }
            $db_connection_info['connected'] = true;
            $db_connection_info['connection'] = $c;
            return $c;
        } else {
            return false;
        }
    } elseif (strcmp($GLOBALS['db_type'], 'mysqli') == 0) {
        $c = new mysqli($host, $login, $password, $database);
        if ($c) {
            if (mysqli_connect_errno() && !empty($database)) {
                return false;
            }
            $db_connection_info['connected'] = true;
            $db_connection_info['connection'] = $GLOBALS['db_connection'] = $c;
            return $c;
        } else {
            return false;
        }
    } elseif (strcmp($GLOBALS['db_type'], 'mssql') == 0) {
        static $old_textlimit, $old_textsize;
        $old_textlimit = ini_get('mssql.textlimit');
        $old_textsize = ini_get('mssql.textsize');
        ini_set('mssql.textlimit', '2147483647');
        ini_set('mssql.textsize', '2147483647');
        $c = $GLOBALS['db_persistent'] ? mssql_pconnect($host, $login, $password) : mssql_connect($host, $login, $password);
        if ($c) {
            if (!mssql_select_db($database)) {
                return false;
            }
            $db_connection_info['connected'] = true;
            $db_connection_info['connection'] = $c;
            return $c;
        } else {
            return false;
        }
    } elseif (strcmp($GLOBALS['db_type'], 'oracle') == 0) {
        $_ora_conn_func = 'OCI' . ($GLOBALS['db_persistent'] ? 'P' : '') . 'Logon';
        $c = $_ora_conn_func($login, $password, strlen($host) && strcmp($host, 'localhost') ? '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = ' . $host . ' ) (PORT = 1521))) (CONNECT_DATA = (SID = ' . $database . ' )))' : $database);
        unset($_ora_conn_func);
        $db_connection_info['connected'] = true;
        $db_connection_info['connection'] = $GLOBALS['oracle_connection'] = $c;
        return $c;
    } elseif (strcmp($GLOBALS['db_type'], 'postgresql') == 0) {
        $dbargs = (strlen($host) ? 'host=' . "{$host} " : '') . 'dbname=' . $database . ' user=' . $login . (strlen($password) ? ' password=' . $password : '');
        $c = $GLOBALS['db_persistent'] ? pg_pconnect($dbargs) : pg_connect($dbargs);
        $GLOBALS['postgresql_connection'] = $c;
        if (!$c) {
            return false;
        }
        $db_connection_info['connected'] = true;
        $db_connection_info['connection'] = $c;
        return $c;
    } elseif (strcmp($GLOBALS['db_type'], 'odbc') == 0) {
        $c = $GLOBALS['db_persistent'] ? odbc_pconnect($database, $login, $password) : odbc_connect($database, $login, $password);
        $db_connection_info['connected'] = true;
        $db_connection_info['connection'] = $GLOBALS['odbc_connection'] = $c;
        return $c;
    } elseif (strcmp($GLOBALS['db_type'], 'ibm_db2') == 0) {
        $c = $GLOBALS['db_persistent'] ? db2_pconnect($database, $login, $password) : db2_connect($database, $login, $password);
        $db_connection_info['connected'] = true;
        $db_connection_info['connection'] = $GLOBALS['ibm_db2_connection'] = $c;
        return $c;
    } elseif (strcmp($GLOBALS['db_type'], 'ibase') == 0) {
        $host = $host . ':' . $database;
        $c = $GLOBALS['db_persistent'] ? ibase_pconnect($host, $login, $password) : ibase_connect($host, $login, $password);
        $db_connection_info['connected'] = true;
        $db_connection_info['connection'] = $c;
        return $c;
    } elseif (strcmp($GLOBALS['db_type'], 'sqlite') == 0) {
        $c = $GLOBALS['db_persistent'] ? sqlite_popen($database, 0666, $db_sqlite_error_str) : sqlite_open($database, 0666, $db_sqlite_error_str);
        if (!$c) {
            echo translate('Error connecting to database') . ": " . $db_sqlite_error_str . ".\n";
//.........这里部分代码省略.........
开发者ID:rhertzog,项目名称:lcs,代码行数:101,代码来源:dbi4php.php



注:本文中的ibase_pconnect函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ibase_prepare函数代码示例发布时间:2022-05-15
下一篇:
PHP ibase_num_fields函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap