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


PHP DBAccess::getHost方法代码示例

本文整理汇总了PHP中DBAccess::getHost方法的典型用法代码示例。如果您正苦于以下问题:PHP DBAccess::getHost方法的具体用法?PHP DBAccess::getHost怎么用?PHP DBAccess::getHost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBAccess的用法示例。


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

示例1: connect

 function connect()
 {
     if (strtoupper($this->dbType) != "MYSQL") {
         return false;
     }
     if ($this->isConnect) {
         return true;
     }
     $hostStr = "";
     if (parent::getHost() != "") {
         $hostStr .= parent::getHost();
     } else {
         return false;
     }
     if (parent::getPort() != 0) {
         $hostStr .= ":" . parent::getPort();
     }
     $this->connection = mysql_connect($hostStr, parent::getUser(), parent::getPassword(), true);
     if (!$this->connection) {
         $this->isConnect = false;
     } else {
         $db_selected = mysql_select_db($this->_dbName, $this->connection);
         if (!$db_selected) {
             $this->isConnect = false;
             $this->disconnect();
         } else {
             $this->isConnect = true;
         }
     }
     return $this->isConnect;
 }
开发者ID:bryanbacus,项目名称:skripsi-martin,代码行数:31,代码来源:MySQLAccess.php

示例2: connect

 function connect()
 {
     if (strtoupper($this->dbType) != "POSTGRES") {
         return false;
     }
     if ($this->isConnect) {
         return true;
     }
     $connectStr = "";
     if (parent::getHost() != "") {
         $connectStr .= "host=" . parent::getHost() . " ";
     } else {
         return false;
     }
     if (parent::getPort() != 0) {
         $connectStr .= "port=" . parent::getPort() . " ";
     }
     if ($this->_dbName != "") {
         $connectStr .= "dbname=" . $this->_dbName . " ";
     } else {
         return false;
     }
     if (parent::getUser() != "") {
         $connectStr .= "user=" . parent::getUser() . " ";
     } else {
         return false;
     }
     if (parent::getPassword() != "") {
         $connectStr .= "password=" . parent::getPassword() . " ";
     }
     $this->connection = pg_connect($connectStr);
     if (!$this->connection) {
         $this->isConnect = false;
     } else {
         $this->isConnect = true;
     }
     return $this->isConnect;
 }
开发者ID:bryanbacus,项目名称:skripsi-martin,代码行数:38,代码来源:PGAccess.php

示例3: parseURL

 function parseURL($url)
 {
     parent::parseURL($url);
     $this->_sid = parent::getHost();
 }
开发者ID:bryanbacus,项目名称:skripsi-martin,代码行数:5,代码来源:ORAAccess.php


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