当前位置: 首页>>代码示例>>PHP>>正文


PHP odbc_pconnect函数代码示例

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


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

示例1: connect

 /**
  * Connects to a database.
  * @return void
  * @throws DibiException
  */
 public function connect(array &$config)
 {
     DibiConnection::alias($config, 'username', 'user');
     DibiConnection::alias($config, 'password', 'pass');
     if (isset($config['resource'])) {
         $this->connection = $config['resource'];
     } else {
         // default values
         if (!isset($config['username'])) {
             $config['username'] = ini_get('odbc.default_user');
         }
         if (!isset($config['password'])) {
             $config['password'] = ini_get('odbc.default_pw');
         }
         if (!isset($config['dsn'])) {
             $config['dsn'] = ini_get('odbc.default_db');
         }
         if (empty($config['persistent'])) {
             $this->connection = @odbc_connect($config['dsn'], $config['username'], $config['password']);
             // intentionally @
         } else {
             $this->connection = @odbc_pconnect($config['dsn'], $config['username'], $config['password']);
             // intentionally @
         }
     }
     if (!is_resource($this->connection)) {
         throw new DibiDriverException(odbc_errormsg() . ' ' . odbc_error());
     }
 }
开发者ID:jakubkulhan,项目名称:shopaholic,代码行数:34,代码来源:odbc.php

示例2: sql_db

 function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
 {
     $mtime = microtime();
     $mtime = explode(" ", $mtime);
     $mtime = $mtime[1] + $mtime[0];
     $starttime = $mtime;
     $this->persistency = $persistency;
     $this->user = $sqluser;
     $this->password = $sqlpassword;
     $this->dbname = $database;
     $this->server = $sqlserver;
     if ($this->persistency) {
         $this->db_connect_id = odbc_pconnect($this->server, "", "");
     } else {
         $this->db_connect_id = odbc_connect($this->server, "", "");
     }
     if ($this->db_connect_id) {
         @odbc_autocommit($this->db_connect_id, off);
         $mtime = microtime();
         $mtime = explode(" ", $mtime);
         $mtime = $mtime[1] + $mtime[0];
         $endtime = $mtime;
         $this->sql_time += $endtime - $starttime;
         return $this->db_connect_id;
     } else {
         $mtime = microtime();
         $mtime = explode(" ", $mtime);
         $mtime = $mtime[1] + $mtime[0];
         $endtime = $mtime;
         $this->sql_time += $endtime - $starttime;
         return false;
     }
 }
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:33,代码来源:db2.php

示例3: 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->dbname = $database;
     $port_delimiter = defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN' ? ',' : ':';
     $this->server = $sqlserver . ($port ? $port_delimiter . $port : '');
     $max_size = @ini_get('odbc.defaultlrl');
     if (!empty($max_size)) {
         $unit = strtolower(substr($max_size, -1, 1));
         $max_size = (int) $max_size;
         if ($unit == 'k') {
             $max_size = floor($max_size / 1024);
         } else {
             if ($unit == 'g') {
                 $max_size *= 1024;
             } else {
                 if (is_numeric($unit)) {
                     $max_size = floor((int) ($max_size . $unit) / 1048576);
                 }
             }
         }
         $max_size = max(8, $max_size) . 'M';
         @ini_set('odbc.defaultlrl', $max_size);
     }
     $this->db_connect_id = $this->persistency ? @odbc_pconnect($this->server, $this->user, $sqlpassword) : @odbc_connect($this->server, $this->user, $sqlpassword);
     return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:31,代码来源:mssql_odbc.php

示例4: connect

 public function connect()
 {
     $this->link = $this->_config['pconnect'] == 0 ? @odbc_connect($this->_config['dsn'], $this->_config['username'], $this->_config['password'], SQL_CUR_USE_ODBC) : odbc_pconnect($this->_config['dsn'], $this->_config['username'], $this->_config['password'], SQL_CUR_USE_ODBC);
     if (!$this->link) {
         $this->halt("Connect to odbc  failed");
     }
 }
开发者ID:quan2010,项目名称:DataDictionaryGenerator,代码行数:7,代码来源:Handler.php

示例5: Fconectar

function Fconectar()
{
    $dsn = "Drypers";
    $usuario = "reporte";
    $clave = "";
    //realizamos la conexion mediante odbc
    $conn = odbc_pconnect($dsn, $usuario, $clave);
    return $conn;
}
开发者ID:KatherinAguilera,项目名称:ProtisaReportes,代码行数:9,代码来源:libreria.php

示例6: _pconnect

 function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
 {
     global $php_errormsg;
     $php_errormsg = '';
     $this->_connectionID = odbc_pconnect($argDSN, $argUsername, $argPassword, $this->curmode);
     $this->_errorMsg = $php_errormsg;
     //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
     return $this->_connectionID != false;
 }
开发者ID:qoire,项目名称:portal,代码行数:9,代码来源:adodb-odbc.inc.php

示例7: connect

 public function connect($config = array())
 {
     $this->config = $config;
     $dsn = !empty($this->config['dsn']) ? $this->config['dsn'] : 'DRIVER=' . $this->config['host'] . ';SERVER=' . $this->config['server'] . ';DATABASE=' . $this->config['database'];
     $this->connect = $this->config['pconnect'] === true ? @odbc_pconnect($dsn, $this->config['user'], $this->config['password']) : @odbc_connect($dsn, $this->config['user'], $this->config['password']);
     if (empty($this->connect)) {
         die(getErrorMessage('Database', 'mysqlConnectError'));
     }
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:9,代码来源:OdbcDriver.php

示例8: 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 ? @odbc_pconnect($this->server, $this->user, $sqlpassword) : @odbc_connect($this->server, $this->user, $sqlpassword);
     return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
 }
开发者ID:MarxGonzalez,项目名称:SemanticScuttle,代码行数:9,代码来源:mssql-odbc.php

示例9: _pconnect

 function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
 {
     global $php_errormsg;
     $php_errormsg = '';
     $this->_connectionID = odbc_pconnect($argDSN, $argUsername, $argPassword, SQL_CUR_USE_ODBC);
     $this->_errorMsg = $php_errormsg;
     $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
     //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
     return $this->_connectionID != false;
 }
开发者ID:qoire,项目名称:portal,代码行数:10,代码来源:adodb-odbc_oracle.inc.php

示例10: connect

 function connect()
 {
     if (0 == $this->Link_ID) {
         $this->Link_ID = odbc_pconnect($this->Database, $this->User, $this->Password, $this->UseODBCCursor);
         if (!$this->Link_ID) {
             $this->halt("Link-ID == false, odbc_pconnect failed");
         }
     }
     return $this->Link_ID;
 }
开发者ID:antirek,项目名称:prestige-pbx,代码行数:10,代码来源:phplib_odbc.php

示例11: sql_db

 function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
 {
     $this->persistency = $persistency;
     $this->server = $sqlserver;
     $this->user = $sqluser;
     $this->password = $sqlpassword;
     $this->dbname = $database;
     $this->db_connect_id = $this->persistency ? odbc_pconnect($this->server, $this->user, $this->password) : odbc_connect($this->server, $this->user, $this->password);
     return $this->db_connect_id ? $this->db_connect_id : false;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:mssql-odbc.php

示例12: selectDatabase

 /**
  * Opens a MS Access database.
  */
 protected function selectDatabase()
 {
     if ($this->usePConnect) {
         $this->linkID = @odbc_pconnect("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" . $this->database, '', '');
     } else {
         $this->linkID = @odbc_connect("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" . $this->database, '', '');
     }
     if ($this->linkID === false) {
         throw new DatabaseException("Cannot use database " . $this->database, $this);
     }
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:14,代码来源:MSAccessDatabase.class.php

示例13: connect

 /**
  * 
  * @todo should perhaps handle this method differently if $options are not passed
  *
  * @param $database
  * @param $user
  * @param $password
  * @param null $options
  * @return bool|resource
  */
 public function connect($database, $user, $password, $options = null)
 {
     if ($options) {
         if (isset($options['persistent']) && $options['persistent']) {
             $conn = odbc_pconnect($database, $user, $password);
         } else {
             $conn = odbc_connect($database, $user, $password);
         }
         if (is_resource($conn)) {
             return $conn;
         }
     }
     $this->setError();
     return false;
 }
开发者ID:zendtech,项目名称:ibmitoolkit,代码行数:25,代码来源:Odbcsupp.php

示例14: connect

 function connect($dsn, $db = '', $user, $password, $persistent = false)
 {
     parent::connect($dsn, $db, $user, $password, $persistent);
     $this->dsn = $dsn;
     $this->host = '';
     $this->db = '';
     if ($persistent) {
         $this->db = odbc_pconnect($dsn, $user, $password);
     } else {
         $this->db = odbc_connect($dsn, $user, $password);
     }
     if ($this->db) {
         return true;
     } else {
         $this->_addError('Error connecting to db!', 'connect()');
         return false;
     }
 }
开发者ID:jsan4christ,项目名称:idrc-uganda-site,代码行数:18,代码来源:OdbcDB.php

示例15: sql_db

 function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true)
 {
     $this->persistency = $persistency;
     $this->user = $sqluser;
     $this->password = $sqlpassword;
     $this->dbname = $database;
     $this->server = $sqlserver;
     if ($this->persistency) {
         $this->db_connect_id = odbc_pconnect($this->server, "", "");
     } else {
         $this->db_connect_id = odbc_connect($this->server, "", "");
     }
     if ($this->db_connect_id) {
         @odbc_autocommit($this->db_connect_id, off);
         return $this->db_connect_id;
     } else {
         return false;
     }
 }
开发者ID:nmpetkov,项目名称:ZphpBB2,代码行数:19,代码来源:db2.php


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