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

PHP mssql_connect函数代码示例

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

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



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

示例1: 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->server = $sqlserver;
     $this->dbname = $database;
     $this->db_connect_id = $this->persistency ? @mssql_pconnect($this->server, $this->user, $this->password) : @mssql_connect($this->server, $this->user, $this->password);
     if ($this->db_connect_id && $this->dbname != "") {
         if (!mssql_select_db($this->dbname, $this->db_connect_id)) {
             mssql_close($this->db_connect_id);
             $mtime = microtime();
             $mtime = explode(" ", $mtime);
             $mtime = $mtime[1] + $mtime[0];
             $endtime = $mtime;
             $this->sql_time += $endtime - $starttime;
             return false;
         }
     }
     $mtime = microtime();
     $mtime = explode(" ", $mtime);
     $mtime = $mtime[1] + $mtime[0];
     $endtime = $mtime;
     $this->sql_time += $endtime - $starttime;
     return $this->db_connect_id;
 }
开发者ID:BackupTheBerlios,项目名称:phpbbsfp,代码行数:30,代码来源:mssql.php


示例2: dbOpen_MSSQL

/**
 * Abra a conexão com o banco de dados MSSQL
 *
 * <code>
 * $mssqlHandle = dbOpen_MSSQL("MSSQL", "database", "user", "password");
 * </code>
 *
 * @param string $dbHost string de conexão com o banco de dados
 * @param string $dbDatabase[optional] string database utilizado
 * @param string $dbUser[optional] nome do usuário
 * @param string $dbPassword[optional] senha do usuário
 *
 * @return array com o handleId e o nome do driver
 *
 * @since Versão 1.0
 */
function dbOpen_MSSQL(&$dbHandle)
{
    $debugBackTrace = debug_backtrace();
    $debugFile = basename($debugBackTrace[1]["file"]);
    $debugFunction = $debugBackTrace[1]["function"];
    $dbDriver = $dbHandle[dbHandleDriver];
    if (!function_exists("mssql_connect")) {
        echo "<span style=\"text-align: left;\"><pre><b>{$dbDriver} - {$debugFile} - {$debugFunction}() - Connect</b>:" . "<br />extension=<b>php_mssql.dll</b> is not loaded";
        echo "<hr />" . debugBackTrace();
        echo "</pre></span>";
        die;
    }
    $dbHost = $dbHandle[dbHandleHost];
    $dbDatabase = $dbHandle[dbHandleDatabase];
    $dbUser = $dbHandle[dbHandleUser];
    $dbPassword = $dbHandle[dbHandlePassword];
    // @TODO Incluir tratamento para ver se o driver está carregado
    if (!($mssqlConn = @mssql_connect($dbHost, $dbUser, $dbPassword))) {
        echo "<span style=\"text-align: left;\"><pre><b>{$dbDriver} - {$debugFile} - {$debugFunction}() - Connect</b>:" . "<br /><b>Connection</b>: " . $dbHost . "<br /><b>Database</b>: " . $dbDatabase . "<br /><b>Message</b>: [" . mssql_get_last_message() . "]";
        echo "<hr />" . debugBackTrace();
        echo "</pre></span>";
        die;
    }
    if (!@mssql_select_db($dbDatabase, $mssqlConn)) {
        echo "<span style=\"text-align: left;\"><pre><b>{$dbDriver} - {$debugFile} - {$debugFunction}() - SelectDB</b>:" . "<br /><b>Connection</b>: " . $dbHost . "<br /><b>Database</b>: " . $dbDatabase . "<br /><b>Message</b>: [" . mssql_get_last_message() . "]";
        echo "<hr />" . debugBackTrace();
        echo "</pre></span>";
        die;
    }
    return $mssqlConn;
}
开发者ID:BGCX262,项目名称:ztag-svn-to-git,代码行数:47,代码来源:dbMSSQL.inc.php


示例3: 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));
     if ($this->flags & DB_PERSISTENT) {
         $this->handle = mssql_pconnect($this->dsn->getHost(), $this->dsn->getUser(), $this->dsn->getPassword());
     } else {
         $this->handle = mssql_connect($this->dsn->getHost(), $this->dsn->getUser(), $this->dsn->getPassword());
     }
     if (!is_resource($this->handle)) {
         $e = new \rdbms\SQLConnectException(trim(mssql_get_last_message()), $this->dsn);
         \xp::gc(__FILE__);
         throw $e;
     }
     \xp::gc(__FILE__);
     $this->_obs && $this->notifyObservers(new \rdbms\DBEvent(\rdbms\DBEvent::CONNECTED, $reconnect));
     return parent::connect();
 }
开发者ID:xp-framework,项目名称:rdbms,代码行数:32,代码来源:MsSQLConnection.class.php


示例4: StartConnection

 /**
  *	Start Connection Server
  *	Connect to Microsoft SQL Server
  *
  *	@return	void
  */
 public function StartConnection()
 {
     if (!extension_loaded("mssql")) {
         if (!extension_loaded("sqlsrv")) {
             return $this->results['Connect'] = "NO_PHP_EXTENSION";
         } else {
             $this->useSqlsrv = TRUE;
         }
     }
     if (!$this->settings['hostport']) {
         $this->settings['hostport'] = 1433;
     }
     $new_link = count($this->connections) > 0;
     $port = (strtoupper(substr(PHP_OS, 0, 3)) === "WIN" ? "," : ":") . $this->settings['hostport'];
     if (!$this->useSqlsrv) {
         if ($this->settings['persistent']) {
             $this->connections[$this->id] = mssql_pconnect($this->settings['hostname'] . $port, $this->settings['username'], $this->settings['password'], $new_link);
         } else {
             $this->connections[$this->id] = mssql_connect($this->settings['hostname'] . $port, $this->settings['username'], $this->settings['password'], $new_link);
         }
     }
     if (!$this->connections[$this->id]) {
         return $this->results['Connect'] = "CONNECTION_FAILED";
     }
     if (!$this->SelectDataBase($this->settings['database'], $this->id)) {
         return $this->results['Connect'] = "DATABASE_FAILED";
     }
     $this->id++;
     $this->connected = TRUE;
     $this->currentLink = $this->id - 1;
     return $this->results['Connect'] = "CONNECTED";
 }
开发者ID:ADMTec,项目名称:effectweb-project,代码行数:38,代码来源:mssqlClient.lib.php


示例5: __construct

 public function __construct($hostname, $userid, $password)
 {
     $this->hostname = $hostname;
     $this->userid = $userid;
     $this->password = $password;
     $this->connection = mssql_connect($hostname, $userid, $password, false);
 }
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:7,代码来源:MSSQLInspector.php


示例6: conn

function conn($DB)
{
    $serverName = "intelisis";
    //serverName\instanceName
    $connectionInfo = array("Database" => $DB, "UID" => "intelisis", "PWD" => "");
    $conn = mssql_connect($serverName, "intelisis", "");
    mssql_select_db($DB, $conn);
    $user = $_SESSION["user"];
    if (!$conn) {
        die('Something went wrong while connecting to MSSQL');
    }
    $con1 = "set dateformat dmy";
    $con1 = mssql_query($con1);
    $con2 = "SET DATEFIRST 7";
    $con2 = mssql_query($con2);
    $con3 = "SET ANSI_NULLS OFF";
    $con3 = mssql_query($con3);
    $con4 = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED";
    $con4 = mssql_query($con4);
    $con5 = "SET LOCK_TIMEOUT -1";
    $con5 = mssql_query($con5);
    $con6 = "SET QUOTED_IDENTIFIER OFF";
    $con6 = mssql_query($con6);
    $con7 = "set language spanish";
    $con7 = mssql_query($con7);
}
开发者ID:Bragiel,项目名称:apmovilprueba,代码行数:26,代码来源:pedidosesp_func.php


示例7: connect

 /**
  * {@inheritdoc}
  */
 public function connect()
 {
     $config = $this->config;
     $config = array_merge($this->baseConfig, $config);
     $os = env('OS');
     if (!empty($os) && strpos($os, 'Windows') !== false) {
         $sep = ',';
     } else {
         $sep = ':';
     }
     $this->connected = false;
     if (is_numeric($config['port'])) {
         $port = $sep . $config['port'];
         // Port number
     } elseif ($config['port'] === null) {
         $port = '';
         // No port - SQL Server 2005
     } else {
         $port = '\\' . $config['port'];
         // Named pipe
     }
     if (!$config['persistent']) {
         $this->connection = mssql_connect($config['host'] . $port, $config['username'], $config['password'], true);
     } else {
         $this->connection = mssql_pconnect($config['host'] . $port, $config['username'], $config['password']);
     }
     if (mssql_select_db($config['database'], $this->connection)) {
         $this->qery('SET DATEFORMAT ymd');
         $this->connected = true;
     }
     return $this->connection;
 }
开发者ID:speedwork,项目名称:database,代码行数:35,代码来源:MssqlDriver.php


示例8: connect

 function connect()
 {
     $this->last_errno = 0;
     $this->last_error = '';
     if (isset($this->mssql)) {
         $this->dbh = @mssql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true);
     } else {
         $this->dbh = @mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true);
     }
     if (!$this->dbh) {
         $this->ready = false;
         if (isset($this->mssql)) {
             $this->last_error = mssql_get_last_message();
             if (empty($this->last_error)) {
                 $this->last_error = 'Unable to connect to mssql: ' . $this->dbhost;
             }
             $this->last_errno = 1;
         } else {
             $this->last_error = mysql_error();
             $this->last_errno = mysql_errno();
         }
         return false;
     }
     $this->ready = true;
     $this->real_escape = true;
     $this->select($this->dbname, $this->dbh);
 }
开发者ID:ahmader,项目名称:database-php,代码行数:27,代码来源:database.php


示例9: _connect

 /**
  * Creates a connection resource.
  */
 protected function _connect()
 {
     if (is_resource($this->_connection)) {
         // connection already exists
         return;
     }
     if (!extension_loaded('mssql')) {
         throw new Exception('The mssql extension is required for this adapter but the extension is not loaded');
     }
     $serverName = $this->_config['host'];
     if (isset($this->_config['port'])) {
         $port = (int) $this->_config['port'];
         $serverName .= ', ' . $port;
     }
     $username = $password = '';
     if (isset($this->_config['username']) && isset($this->_config['password'])) {
         $username = $this->_config['username'];
         $password = $this->_config['password'];
     }
     $this->_connection = mssql_connect($serverName, $username, $password);
     if (!$this->_connection) {
         throw new Exception('Mssql Connection Error: ' . mssql_get_last_message());
     }
     if (isset($this->_config['dbname']) && !mssql_select_db($this->_config['dbname'])) {
         throw new Exception('Unable to connect or select database ' . $this->_config['dbname']);
     }
 }
开发者ID:diglin,项目名称:diglin_mssql,代码行数:30,代码来源:Mssql.php


示例10: sql_connect

 /**
  * Connect to server
  */
 function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
 {
     if (!function_exists('mssql_connect')) {
         $this->connect_error = 'mssql_connect function does not exist, is mssql extension installed?';
         return $this->sql_error('');
     }
     $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 : '');
     @ini_set('mssql.charset', 'UTF-8');
     @ini_set('mssql.textlimit', 2147483647);
     @ini_set('mssql.textsize', 2147483647);
     if (version_compare(PHP_VERSION, '5.1.0', '>=') || version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.1', '>=')) {
         $this->db_connect_id = $this->persistency ? @mssql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mssql_connect($this->server, $this->user, $sqlpassword, $new_link);
     } else {
         $this->db_connect_id = $this->persistency ? @mssql_pconnect($this->server, $this->user, $sqlpassword) : @mssql_connect($this->server, $this->user, $sqlpassword);
     }
     if ($this->db_connect_id && $this->dbname != '') {
         if (!@mssql_select_db($this->dbname, $this->db_connect_id)) {
             @mssql_close($this->db_connect_id);
             return false;
         }
     }
     return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
 }
开发者ID:eyumay,项目名称:ju.ejhs,代码行数:30,代码来源:mssql.php


示例11: __construct

 /**
  * Constructor 
  * 
  * @param $dsn string DSN for the connection
  */
 public function __construct($dsn)
 {
     $this->config = parse_url($dsn);
     if (!$this->config) {
         throw new DatabaseException("Invalid dsn '{$dsn}'.");
     }
     $database = trim($this->config['path'], '/');
     if (isset($this->config['host'])) {
         $host = $this->config['host'];
     }
     if (isset($this->config['user'])) {
         $user = $this->config['user'];
     }
     if (isset($this->config['port'])) {
         $port = $this->config['port'];
     }
     if (isset($this->config['pass'])) {
         $pass = $this->config['pass'];
     }
     $this->connection = mssql_connect($host, $user, $pass);
     if (!$this->connection) {
         throw new DatabaseException("Invalid database settings.");
     }
     if (!mssql_select_db($database, $this->connection)) {
         throw new DatabaseException("Database does not exist");
     }
 }
开发者ID:jawngee,项目名称:HeavyMetal,代码行数:32,代码来源:mssql.php


示例12: getProductos

function getProductos()
{
    $myServer = "172.30.5.49";
    $myUser = "UsrPsg";
    $myPass = "PsGcRm1402*LaU+";
    $myDB = "LAUMAYER";
    $dbhandle = mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on {$myServer}");
    $selected = mssql_select_db($myDB, $dbhandle) or die("Couldn't open database {$myDB}");
    //Realiza el query en la base de datos
    $mysqli = makeSqlConnection();
    //$sql = "SELECT * FROM psg_productos a LEFT JOIN psg_productos_cstm ac ON a.id = ac.id_c";
    $sql = "SELECT id,name FROM psg_productos where deleted ='0'";
    $res = $mysqli->query($sql);
    $rows = array();
    while ($r = mysqli_fetch_assoc($res)) {
        $obj = (object) $r;
        $querySaldo = "Select dbo.F_Saldo_Bodega_Informe(Year(GETDATE()),MONTH(GETDATE()),'" . $r['id'] . "','BODPRDCTO','T','C') as Saldo";
        $result = mssql_query($querySaldo);
        if ($row = mssql_fetch_array($result)) {
            $obj->saldo = $row['Saldo'];
        }
        $a = (array) $obj;
        $rows[] = $a;
    }
    mssql_close($dbhandle);
    if (empty($rows)) {
        return '{"results" :[]}';
    } else {
        //Convierte el arreglo en json y lo retorna
        $temp = json_encode(utf8ize($rows));
        return '{"results" :' . $temp . '}';
    }
}
开发者ID:ekutor,项目名称:hermes,代码行数:33,代码来源:getProductos.php


示例13: 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;

		@ini_set('mssql.charset', 'UTF-8');
		@ini_set('mssql.textlimit', 2147483647);
		@ini_set('mssql.textsize', 2147483647);

		if (version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.1', '>=')))
		{
			$this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mssql_connect($this->server, $this->user, $sqlpassword, $new_link);
		}
		else
		{
			$this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword) : @mssql_connect($this->server, $this->user, $sqlpassword);
		}

		if ($this->db_connect_id && $this->dbname != '')
		{
			if (!@mssql_select_db($this->dbname, $this->db_connect_id))
			{
				@mssql_close($this->db_connect_id);
				return false;
			}
		}

		return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
	}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:34,代码来源:mssql.php


示例14: getDbConnect

 private function getDbConnect($address, $account, $pwd, $name)
 {
     if (DB_TYPE == 'mssql') {
         return mssql_connect($address, $account, $pwd);
     }
     if (DB_TYPE == 'sqlsrv') {
         if (defined('DBITPro_Dev')) {
             $connectionInfo = array("UID" => $account, "PWD" => $pwd, "Database" => $name);
         } else {
             $connectionInfo = array("UID" => $account, "PWD" => $pwd, "Database" => $name);
         }
         $conn = sqlsrv_connect($address, $connectionInfo);
         if (false === $conn) {
             echo "Could not connect.\n";
             die(print_r(sqlsrv_errors(), true));
         }
         return $conn;
     }
     if (DB_TYPE == 'mysql') {
         $conn = mysql_connect($address, $account, $pwd);
         if (false === $conn) {
             echo "Could not connect.\n";
             die(print_r(mysql_errors(), true));
         }
         return $conn;
     }
 }
开发者ID:bciv,项目名称:COMS,代码行数:27,代码来源:sqlquery.class.php


示例15: db_connect

 /**
  * Non-persistent database connection
  *
  * @access	private called by the base class
  * @return	resource
  */
 function db_connect()
 {
     if ($this->port != '') {
         $this->hostname .= ',' . $this->port;
     }
     return @mssql_connect($this->hostname, $this->username, $this->password);
 }
开发者ID:arifh28,项目名称:siskalite,代码行数:13,代码来源:mssql_driver.php


示例16: __construct

 function __construct($server = DB_HOST, $username = DB_USER, $password = DB_PASSWORD, $database_name = DB_NAME, $table_prefix = DB_TABLE_PREFIX, $db_type = DB_TYPE_MYSQL)
 {
     $this->db_type = $db_type;
     switch ($this->db_type) {
         case DB_TYPE_MYSQL:
             $this->link = mysql_connect($server, $username, $password, true);
             if (!$this->link) {
                 die("Cannot connect to DB");
             }
             if (!mysql_select_db($database_name, $this->link)) {
                 die("Cannot select db");
             }
             break;
         case DB_TYPE_MYSQLI:
             $this->link = mysqli_connect($server, $username, $password, $database_name);
             if (!$this->link) {
                 die("Cannot connect to DB");
             }
             break;
         case DB_TYPE_MSSQL:
             $this->link = mssql_connect($server, $username, $password, true);
             if (!$this->link) {
                 die("Cannot connect to DB");
             }
             if (!mssql_select_db($database_name, $this->link)) {
                 die("Cannot select db");
             }
             break;
     }
     $this->table_prefix = $table_prefix;
 }
开发者ID:sjurajpuchky,项目名称:cf,代码行数:31,代码来源:db.php


示例17: __construct

 /**
  * Database object constructor
  * @param string Database host
  * @param string Database user name
  * @param string Database user password
  * @param string Database name
  * @param string Common prefix for all tables
  */
 function __construct($options)
 {
     //var_dump_pre($options);
     $host = array_key_exists('host', $options) ? $options['host'] : 'localhost';
     $user = array_key_exists('user', $options) ? $options['user'] : '';
     $password = array_key_exists('password', $options) ? $options['password'] : '';
     $database = array_key_exists('database', $options) ? $options['database'] : '';
     $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : 'jos_';
     $select = array_key_exists('select', $options) ? $options['select'] : true;
     // perform a number of fatality checks, then return gracefully
     if (!function_exists('mssql_connect')) {
         $this->_errorNum = 1;
         $this->_errorMsg = 'The MSSQL adapter "mssql" is not available.';
         return;
     }
     // connect to the server
     if (!($this->_resource = @mssql_connect($host, $user, $password, true))) {
         $this->_errorNum = 2;
         $this->_errorMsg = 'Could not connect to MSSQL: ' . mssql_get_last_message();
         print_r($this->_resource);
         return;
     } else {
         $this->connected = true;
     }
     // finalize initializations
     parent::__construct($options);
     // select the database
     if ($select) {
         $this->select('[' . $database . ']');
     }
 }
开发者ID:Jonathonbyrd,项目名称:SportsCapping-Experts,代码行数:39,代码来源:mssql.php


示例18: Open

function Open($dbType, $connectType = "c", $connect, $username = "", $password = "", $dbName)
{
    switch ($dbType) {
        case "mssql":
            if ($connectType == "c") {
                $idCon = mssql_connect($connect, $username, $password);
            } else {
                $idCon = mssql_pconnect($connect, $username, $password);
            }
            mssql_select_db($dbName);
            break;
        case "mysql":
            if ($connectType == "c") {
                $idCon = @mysql_connect($connect, $username, $password);
            } else {
                $idCon = @mysql_pconnect($connect, $username, $password);
            }
            $idCon1 = mysql_select_db($dbName, $idCon);
            break;
        case "pg":
            if ($connectType == "c") {
                $idCon = pg_connect($connect . " user=" . $username . " password=" . $password . " dbname=" . $dbName);
            } else {
                $idCon = pg_pconnect($connect . " user=" . $username . " password=" . $password . " dbname=" . $dbName);
            }
            break;
        default:
            $idCon = 0;
            break;
    }
    return $idCon;
}
开发者ID:laiello,项目名称:ebpls,代码行数:32,代码来源:multidbconnection.php


示例19: __construct

 function __construct()
 {
     // Load Configuration for this Module
     global $configArray;
     $this->hipUrl = $configArray['Catalog']['hipUrl'];
     $this->hipProfile = $configArray['Catalog']['hipProfile'];
     $this->selfRegProfile = $configArray['Catalog']['selfRegProfile'];
     // Connect to database
     if (!isset($configArray['Catalog']['useDb']) || $configArray['Catalog']['useDb'] == true) {
         try {
             if (strcasecmp($configArray['System']['operatingSystem'], 'windows') == 0) {
                 sybase_min_client_severity(11);
                 $this->db = @sybase_connect($configArray['Catalog']['database'], $configArray['Catalog']['username'], $configArray['Catalog']['password']);
             } else {
                 $this->db = mssql_connect($configArray['Catalog']['host'] . ':' . $configArray['Catalog']['port'], $configArray['Catalog']['username'], $configArray['Catalog']['password']);
                 // Select the database
                 mssql_select_db($configArray['Catalog']['database']);
             }
         } catch (Exception $e) {
             global $logger;
             $logger->log("Could not load Horizon database", PEAR_LOG_ERR);
         }
     } else {
         $this->useDb = false;
     }
 }
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:26,代码来源:Horizon.php


示例20: Connect

 /**
  * @return bool
  */
 function Connect()
 {
     //if ($this->_conectionHandle != false) return true;
     if (!extension_loaded('mssql')) {
         $this->ErrorDesc = 'Can\'t load MsSQL extension.';
         setGlobalError($this->ErrorDesc);
         $this->_log->WriteLine($this->ErrorDesc);
         return false;
     }
     $ti = getmicrotime();
     $this->_conectionHandle = @mssql_connect($this->_host, $this->_user, $this->_password);
     $this->_log->WriteLine('>> CONNECT TIME - ' . (getmicrotime() - $ti));
     if ($this->_conectionHandle) {
         if (strlen($this->_dbName) > 0) {
             $dbselect = @mssql_select_db($this->_dbName, $this->_conectionHandle);
             if (!$dbselect) {
                 $this->_setSqlError();
                 $this->_conectionHandle = $dbselect;
                 @mssql_close($this->_conectionHandle);
                 return false;
             }
         }
         return true;
     } else {
         $this->_setSqlError();
         return false;
     }
 }
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:class_dbmssql.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP mssql_data_seek函数代码示例发布时间:2022-05-15
下一篇:
PHP mssql_close函数代码示例发布时间: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