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

PHP sybase_connect函数代码示例

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

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



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

示例1: CreateDatabase

 function CreateDatabase()
 {
     global $dcl_domain_info, $dcl_domain;
     $conn = sybase_connect($dcl_domain_info[$dcl_domain]['dbHost'], $dcl_domain_info[$dcl_domain]['dbUser'], $dcl_domain_info[$dcl_domain]['dbPassword']);
     $query = sprintf('Create Database %s', $dcl_domain_info[$dcl_domain]['dbName']);
     return sybase_query($query, $conn) > 0;
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:7,代码来源:class.DCL_DB_sybase.inc.php


示例2: 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 = sybase_pconnect($this->dsn->getHost(), $this->dsn->getUser(), $this->dsn->getPassword(), 'utf8');
     } else {
         $this->handle = sybase_connect($this->dsn->getHost(), $this->dsn->getUser(), $this->dsn->getPassword(), 'utf8');
     }
     if (!is_resource($this->handle)) {
         $e = new \rdbms\SQLConnectException(trim(sybase_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,代码来源:SybaseConnection.class.php


示例3: __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


示例4: 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 @sybase_connect($this->hostname, $this->username, $this->password);
 }
开发者ID:belalangkunyit,项目名称:ci30sybase,代码行数:13,代码来源:sybase_driver.php


示例5: getDB

 protected function getDB()
 {
     $link = @sybase_connect('sulcmis3', 'sa', '*****') or die("不能连接数据库!");
     //连接数据库,第一空必须写服务名称,不能是ip;
     $db = @sybase_select_db("sulcmis", $link) or die("数据库没有选择");
     echo "getDB";
     echo $link;
     return $link;
 }
开发者ID:blackjackedu,项目名称:FreeMLib,代码行数:9,代码来源:BookSearch.php


示例6: db_sybase

 function db_sybase($host, $user, $passwd, $db = null)
 {
     $this->db_name = $db;
     $this->db_user = $user;
     $this->db_passwd = $passwd;
     $this->db_host = $host;
     $this->db_link_ptr = sybase_connect($host, $user, $passwd) or die("Couldn't connect to Sybase Server on {$host}");
     $this->dbhandler = @sybase_select_db($db);
 }
开发者ID:rezarahimi4861,项目名称:icmf,代码行数:9,代码来源:sybase.php


示例7: connect

 public function connect($config = array())
 {
     $this->config = $config;
     $this->connect = $this->config['pconnect'] === true ? @sybase_pconnect($this->config['host'], $this->config['user'], $this->config['password'], $this->config['charset'], $this->config['appname']) : @sybase_connect($this->config['host'], $this->config['user'], $this->config['password'], $this->config['charset'], $this->config['appname']);
     if (empty($this->connect)) {
         die(getErrorMessage('Database', 'mysqlConnectError'));
     }
     sybase_select_db($this->config['database'], $this->connect);
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:9,代码来源:SybaseDriver.php


示例8: _connect

 function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
 {
     $this->_connectionID = sybase_connect($argHostname, $argUsername, $argPassword);
     if ($this->_connectionID === false) {
         return false;
     }
     if ($argDatabasename) {
         return $this->SelectDB($argDatabasename);
     }
     return true;
 }
开发者ID:qoire,项目名称:portal,代码行数:11,代码来源:adodb-sybase.inc.php


示例9: connect

 /**
  * Connects to the database using options in the given configuration array.
  *
  * @return boolean True if the database could be connected, else false
  */
 function connect()
 {
     $config = $this->config;
     $this->connected = false;
     if (!$config['persistent']) {
         $this->connection = sybase_connect($config['host'], $config['login'], $config['password'], true);
     } else {
         $this->connection = sybase_pconnect($config['host'], $config['login'], $config['password']);
     }
     if (sybase_select_db($config['database'], $this->connection)) {
         $this->connected = true;
     }
     return $this->connected;
 }
开发者ID:quinns,项目名称:REST-API,代码行数:19,代码来源:dbo_sybase.php


示例10: connect

 /**
  * Connects to the database using options in the given configuration array.
  *
  * @return boolean True if the database could be connected, else false
  */
 function connect()
 {
     $config = $this->config;
     $port = '';
     if ($config['port'] !== null) {
         $port = ':' . $config['port'];
     }
     if ($config['persistent']) {
         $this->connection = sybase_pconnect($config['host'] . $port, $config['login'], $config['password']);
     } else {
         $this->connection = sybase_connect($config['host'] . $port, $config['login'], $config['password'], true);
     }
     $this->connected = sybase_select_db($config['database'], $this->connection);
     return $this->connected;
 }
开发者ID:christianallred,项目名称:fluent_univ,代码行数:20,代码来源:dbo_sybase.php


示例11: connect

 /**
  * Connect to the database server and select the database
  */
 protected function connect()
 {
     $strHost = $GLOBALS['TL_CONFIG']['dbHost'];
     if ($GLOBALS['TL_CONFIG']['dbPort']) {
         $strHost .= ':' . $GLOBALS['TL_CONFIG']['dbPort'];
     }
     if ($GLOBALS['TL_CONFIG']['dbPconnect']) {
         $this->resConnection = @sybase_pconnect($strHost, $GLOBALS['TL_CONFIG']['dbUser'], $GLOBALS['TL_CONFIG']['dbPass'], $GLOBALS['TL_CONFIG']['dbCharset']);
     } else {
         $this->resConnection = @sybase_connect($strHost, $GLOBALS['TL_CONFIG']['dbUser'], $GLOBALS['TL_CONFIG']['dbPass'], $GLOBALS['TL_CONFIG']['dbCharset']);
     }
     if (is_resource($this->resConnection)) {
         @sybase_select_db($GLOBALS['TL_CONFIG']['dbDatabase']);
     }
 }
开发者ID:jens-wetzel,项目名称:use2,代码行数:18,代码来源:DB_Sybase.php


示例12: connect

 function connect($dbuser = '', $dbpassword = '', $dbhost = 'localhost')
 {
     global $ezsql_sybase_str;
     $return_val = false;
     // Must have a user and a password
     if (!$dbuser) {
         $this->register_error($ezsql_sybase_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__);
         $this->show_errors ? trigger_error($ezsql_sybase_str[1], E_USER_WARNING) : null;
     } else {
         if (!($this->dbh = @sybase_connect($dbhost, $dbuser, $dbpassword))) {
             $this->register_error($ezsql_sybase_str[2] . ' in ' . __FILE__ . ' on line ' . __LINE__);
             $this->show_errors ? trigger_error($ezsql_sybase_str[2], E_USER_WARNING) : null;
         } else {
             $this->dbuser = $dbuser;
             $this->dbpassword = $dbpassword;
             $this->dbhost = $dbhost;
             $return_val = true;
         }
     }
     return $return_val;
 }
开发者ID:BGCX067,项目名称:ezsqlhelper-svn-to-git,代码行数:21,代码来源:ez_sql_sybase.php


示例13: 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
     if ($this->flags & DB_PERSISTENT) {
         $this->handle = sybase_pconnect($this->dsn->getHost(), $this->dsn->getUser(), $this->dsn->getPassword(), 'iso_1');
     } else {
         $this->handle = sybase_connect($this->dsn->getHost(), $this->dsn->getUser(), $this->dsn->getPassword(), 'iso_1');
     }
     if (!is_resource($this->handle)) {
         $e = new SQLConnectException(trim(sybase_get_last_message()), $this->dsn);
         xp::gc(__FILE__);
         throw $e;
     }
     xp::gc(__FILE__);
     $this->_obs && $this->notifyObservers(new DBEvent(__FUNCTION__, $reconnect));
     return parent::connect();
 }
开发者ID:Gamepay,项目名称:xp-framework,代码行数:31,代码来源:SybaseConnection.class.php


示例14: _connect

	function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
	{
		if (!function_exists('sybase_connect')) return null;

		if ($this->charSet) {
 			$this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword, $this->charSet);
       	} else {
       		$this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword);
       	}

		$this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword);
		if ($this->_connectionID === false) return false;
		if ($argDatabasename) return $this->SelectDB($argDatabasename);
		return true;
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:15,代码来源:adodb-sybase.inc.php


示例15: _connect

 function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
 {
     if (!function_exists('sybase_connect')) {
         return null;
     }
     $this->_connectionID = sybase_connect($argHostname, $argUsername, $argPassword);
     if ($this->_connectionID === false) {
         return false;
     }
     if ($argDatabasename) {
         return $this->selectDB($argDatabasename);
     }
     return true;
 }
开发者ID:dasatti,项目名称:dashboard,代码行数:14,代码来源:adodb-sybase.inc.php


示例16: db_connect

function db_connect()
{
    global $base_host, $base_port, $base_name, $base_user, $base_pass, $base, $conn, $charset;
    $RST = '';
    if ($base == 'pgsql') {
        $conn = "host=" . $base_host . " port=" . $base_port . " dbname=" . $base_name . " user=" . $base_user . " password=" . $base_pass . "";
        $db = pg_connect($conn);
    }
    if ($base == 'mysqlPDO') {
        //$conn=mysql_connect($base_host,$base_user,$base_pass) or die ("Erro de Conexao !");
        $txt = 'mysql:host=' . $base_host . ';dbname=' . $base_name . ';charset=utf8';
        //.$charset;
        $conn = new PDO($txt, $base_user, $base_pass);
        //$banco=mysql_select_db(trim($base_name),$conn) or die ("Erro ao Selecionar o Banco !");
        $RST = 'MYSQL';
    }
    if ($base == 'mysql') {
        $conn = mysql_connect($base_host, $base_user, $base_pass) or die("Erro de Conexao !");
        $banco = mysql_select_db(trim($base_name), $conn) or die("Erro ao Selecionar o Banco !");
        $RST = 'MYSQL';
    }
    if ($base == 'mssql') {
        $conn = mssql_connect($base_host, $base_user, $base_pass) or die("Erro de Conex�o !");
        $banco = mssql_select_db($base_name, $conn) or die("Erro ao Selecionar o Banco !");
        $RST = 'MSSQL';
    }
    if ($base == 'sybase') {
        $conn = sybase_connect($base_host, $base_user, $base_pass) or die("Erro de Conex�o !");
        $banco = sybase_select_db($base_name, $conn) or die("Erro ao Selecionar o Banco !");
        $RST = 'MSSQL';
    }
    return $RST;
}
开发者ID:bireme,项目名称:proethos,代码行数:33,代码来源:sisdoc_sql.php


示例17: sql_connect

function sql_connect($host, $user, $password, $db)
{
    global $dbtype;
    switch ($dbtype) {
        case "MySQL":
            $dbi = @mysql_connect($host, $user, $password);
            mysql_select_db($db);
            return $dbi;
            break;
        case "mSQL":
            $dbi = msql_connect($host);
            msql_select_db($db);
            return $dbi;
            break;
        case "postgres":
            $dbi = @pg_connect("host={$host} user={$user} password={$password} port=5432 dbname={$db}");
            return $dbi;
            break;
        case "postgres_local":
            $dbi = @pg_connect("user={$user} password={$password} dbname={$db}");
            return $dbi;
            break;
        case "ODBC":
            $dbi = @odbc_connect($db, $user, $password);
            return $dbi;
            break;
        case "ODBC_Adabas":
            $dbi = @odbc_connect($host . ":" . $db, $user, $password);
            return $dbi;
            break;
        case "Interbase":
            $dbi = @ibase_connect($host . ":" . $db, $user, $password);
            return $dbi;
            break;
        case "Sybase":
            $dbi = @sybase_connect($host, $user, $password);
            sybase_select_db($db, $dbi);
            return $dbi;
            break;
        default:
            break;
    }
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:43,代码来源:sql_layer.php


示例18: init

 /**
  * Initialize the driver.
  *
  * Validate configuration and perform all resource-intensive tasks needed to
  * make the driver active.
  *
  * @throws ILSException
  * @return void
  */
 public function init()
 {
     parent::init();
     // initialize DAIA parent
     if (isset($this->config['Catalog']['opaciln'])) {
         $this->opaciln = $this->config['Catalog']['opaciln'];
     }
     if (isset($this->config['Catalog']['opacfno'])) {
         $this->opacfno = $this->config['Catalog']['opacfno'];
     }
     if (isset($this->config['Catalog']['opcloan'])) {
         $this->opcloan = $this->config['Catalog']['opcloan'];
     }
     if (isset($this->config['Catalog']['database'])) {
         putenv("SYBASE=" . $this->config['Catalog']['sybpath']);
         $this->db = sybase_connect($this->config['Catalog']['sybase'], $this->config['Catalog']['username'], $this->config['Catalog']['password']);
         sybase_select_db($this->config['Catalog']['database']);
     } else {
         throw new ILSException('No Database.');
     }
 }
开发者ID:bbeckman,项目名称:NDL-VuFind2,代码行数:30,代码来源:LBS4.php


示例19: connect

 protected function connect(&$username, &$password, &$driver_options)
 {
     $host = isset($this->dsn['host']) ? $this->dsn['host'] : 'SYBASE';
     $dbname = isset($this->dsn['dbname']) ? $this->dsn['dbname'] : '';
     $charset = isset($this->dsn['charset']) ? intval($this->dsn['charset']) : '';
     if (isset($driver_options[PDO::ATTR_PERSISTENT]) && $driver_options[PDO::ATTR_PERSISTENT]) {
         $this->link = @sybase_pconnect($host, $username, $password, $charset);
     } else {
         // hope this opens a new connection every time
         $app_name = uniqid('phppdo_');
         $this->link = @sybase_connect($host, $username, $password, $charset, $app_name);
     }
     if (!$this->link) {
         $this->set_driver_error('28000', PDO::ERRMODE_EXCEPTION, '__construct');
     }
     if ($dbname) {
         if (!@sybase_select_db($dbname, $this->link)) {
             $this->set_driver_error(null, PDO::ERRMODE_EXCEPTION, '__construct');
         }
     }
 }
开发者ID:Deepab23,项目名称:clinic,代码行数:21,代码来源:sybase.php


示例20: die

<?php

//phpinfo();
$link = @sybase_connect('lltang2000', 'sa', '******') or die("Could not connect !");
//连接数据库,第一空必须写服务名称,不能是ip;
echo "Connected successfully<br>";
$db = @sybase_select_db("sulcmis", $link) or die("数据库没有选择");
echo "数据库选择成功<br>";
$sql = "select ctrlNo,F200,F210c from b_brief where ctrlNo<100";
$rs = sybase_query($sql, $link);
//查询表
if (!$rs) {
    echo "SQL:" . $sql . "执行失败!";
    exit;
}
//$sybase = sybase_fetch_array($rs);
//print_r($sybase);//结束
echo '<table border="1"><tr><td>CtrlNO</td><td>F200</td><td>F210c</td>';
while ($row = sybase_fetch_array($rs)) {
    $id = $row["ctrlNo"];
    $F200 = $row["F200"];
    $F210c = $row["F210c"];
    echo '<tr><td>' . $id . '</td><td>' . $F200 . '</td><td>' . $F210c . '</td></tr>';
}
echo '</table>';
sybase_free_result($rs);
sybase_close($link);
?>

开发者ID:blackjackedu,项目名称:FreeMLib,代码行数:28,代码来源:index.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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