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


PHP OCILogon函数代码示例

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


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

示例1: __conecta

 /**
  * Método de conexão com o banco de dados mysql
  * @name  __conecta
  * @return Object
  * @access  Protected
  * @author  Paulo Teixeira
  * @package  connectionDb
  */
 public function __conecta()
 {
     global $typedb;
     $this->datasource = "FW";
     $this->host = "localhost";
     //$this -> username = "framework";
     $this->username = "root";
     $this->senha = "090302";
     //$this -> dbName = "xe";
     //$this -> port = 1521;
     $this->dbName = "infinitum_eprocurement";
     $this->port = 3306;
     if ($this->typedb == "mysql") {
         $this->mysql = new mysqli($this->host, $this->username, $this->senha, $this->dbName, $this->port);
         return $this->mysql;
     }
     if ($this->typedb == "oracle") {
         $this->dbDescription = "(DESCRIPTION=";
         $this->dbDescription .= " (ADDRESS_LIST=";
         $this->dbDescription .= "     (ADDRESS=(PROTOCOL=TCP)";
         $this->dbDescription .= "        (HOST={$this->host})(PORT={$this->port})";
         $this->dbDescription .= "     )";
         $this->dbDescription .= " )";
         $this->dbDescription .= " (CONNECT_DATA=(SERVICE_NAME={$this->dbName}))";
         $this->dbDescription .= ")";
         if ($this->oracle = OCILogon($this->username, $this->senha, $this->dbDescription)) {
             return $this->oracle;
         } else {
             $this->err = OCIError();
             return false;
         }
     }
 }
开发者ID:stagoe90,项目名称:InfinitumEprocurement,代码行数:41,代码来源:connectionDb.class.php

示例2: click_insert

function click_insert($B_code)
{
	include("./include/config.inc.php");
	$connect = OCILogon($dbuser,$dbpass,$db);
	$strSQL = "INSERT INTO BIN_SELL ";
	$strSQL .="(BARCODE) ";
	$strSQL .="VALUES ";
	$strSQL .="('".$B_code."') ";
	$objParse = oci_parse ($connect, $strSQL);
	$objExecute = oci_execute($objParse, OCI_DEFAULT);
	if($objExecute)
{
	oci_commit($connect); //*** Commit Transaction ***//
	echo "Save Done.";
	$_SESSION["check"]=1;
}
else
{
	oci_rollback($connect); //*** RollBack Transaction ***//
	echo "Error Save [".$strSQL."";
	$check_in = 0;
}

oci_close($connect);
}
开发者ID:pingkunga,项目名称:cp342-computer777,代码行数:25,代码来源:search_sell_test.php

示例3: openConnection

 public function openConnection()
 {
     $ret = 0;
     if (!($ret = OCILogon($this->user, $this->pass, $this->base))) {
         throw new Exception("Error connect OCI");
     }
     return $ret;
 }
开发者ID:rawork,项目名称:colors-life,代码行数:8,代码来源:ociConnector.php

示例4: get_oracle_db

function get_oracle_db()
{
    global $oracle_db;
    if (!is_object($oracle_db)) {
        $oracle_db = OCILogon('hoau_web', 'wtnt2008', '//192.168.1.240/hydb');
    }
    return $oracle_db;
}
开发者ID:sauger,项目名称:forbes_front,代码行数:8,代码来源:oracle_data_handler.php

示例5: connect

 function connect()
 {
     $this->conn = OCILogon($this->db_user, $this->db_pwd, $this->db_name);
     $cmd = "alter session set nls_date_format = 'DD/MM/YYYY'";
     $query = OCIParse($this->conn, $cmd);
     OCIExecute($query);
     OCIcommit($this->conn);
     return $this->conn;
 }
开发者ID:pamcruz,项目名称:unimedjp,代码行数:9,代码来源:OracleDB.php

示例6: open

 public function open($save_path, $name)
 {
     self::$_lifeTime = get_cfg_var("session.gc_maxlifetime");
     try {
         self::$_db = OCILogon(self::$_conn["params"]["username"], self::$_conn["params"]["password"], self::$_conn["params"]["dbname"], 'AL32UTF8');
     } catch (Exception $e) {
         self::$_db = $e;
     }
     return self::$_db;
 }
开发者ID:marcelocaixeta,项目名称:zf1,代码行数:10,代码来源:Db.php

示例7: connect

 function connect($db_host, $db_user, $db_pwd, $db_name, $pconnect)
 {
     $this->conn = OCILogon($db_user, $db_pwd, $db_name);
     $this->user = $db_user;
     $this->pwd = $db_pwd;
     $this->base = $db_name;
     $cmd = "alter session set nls_date_format = 'DD/MM/YYYY'";
     $query = OCIParse($this->conn, $cmd);
     OCIExecute($query);
     OCIcommit($this->conn);
     return $this->conn;
 }
开发者ID:pamcruz,项目名称:unimedjp,代码行数:12,代码来源:oracle.class.php

示例8: GetInformations

 function GetInformations()
 {
     //    $query = "select log_nom,log_prenom,log_fonction,log_fonctions, log_equipes,log_uf,log_uid from hopi.log where log_idsession = ".$this->hopisession ;
     $query = "select * from hopi.log where log_idsession = " . $this->hopisession;
     if (function_exists('OCILogon')) {
         $conn = @OCILogon("hopi", "hopi", "hopi");
         $stmt = @OCIParse($conn, $query);
         @OCIExecute($stmt);
         $nrows = @OCIFetchStatement($stmt, $results);
         $ldap = new clAuthLdap();
         if ($nrows > 0) {
             $_POST['login'] = $results["LOG_UID"][0];
             $ldap->valide('noBind');
             $_SESSION['hopisession'] = '';
             return $ldap->getInformations();
         }
         /*
         if ( $nrows > 0 ) {
           $log[uid] = $results["LOG_UID"][0] ;
         
           $log[nom] = $results["LOG_NOM"][0] ;
           $log[prenom] = $results["LOG_PRENOM"][0] ;
           $log[fonction] = $results["LOG_FONCTION"][0] ;
           $log[fonctions] = explode ( ',', $results["LOG_FONCTIONS"][0] ) ;
           $log[equipes] = explode ( ',', $results["LOG_EQUIPES"][0] ) ;
           $log[uf] = $results["LOG_UF"][0] ;
         	$log[org] = $results["LOG_ORGANISATION"][0] ;
         } else { $log = "false" ; }
         $infos[type]   = "Hopi" ;
         $infos[nom]    = $log[nom] ;
         $infos[prenom] = $log[prenom] ;
         $infos[iduser] = $log[uid] ;
         $infos[pseudo] = "Hopi (".$log[uid].")" ;
         $infos[mail]   = $log[uid]."@ch-hyeres.fr" ;
         $infos[uf]     = explode ( ",", str_ireplace ( "'", '', $results["LOG_UF"][0] ) ) ;
         $infos[org]    = $log[org] ;
         
         // Récupération de la liste des groupes.
         for ( $i = 0 ; isset ( $log[equipes][$i] ) ; $i++ ) $or_equipes .= " OR nomgroupe='".$log[equipes][$i]."'" ;
         for ( $i = 0 ; isset ( $log[fonctions][$i] ) ; $i++ ) $or_fonctions .= " OR nomgroupe='".$log[fonctions][$i]."'" ;
         $param[cw] = "where nomgroupe='HOPI' OR nomgroupe='".$log[uid]."' OR nomgroupe='".$log[fonction]."' $or_equipes $or_fonctions" ;
         $req = new clResultQuery ;
         $res = $req -> Execute ( "Fichier", "getGroupes", $param, "ResultQuery" ) ;
         $infos[idgroupe] = $res[idgroupe][0] ;
         for ( $j = 1 ; isset ( $res[idgroupe][$j] ) ; $j++ ) {
           $infos[idgroupe] .= ",".$res[idgroupe][$j] ;
         }
         //print "<br>Groupe(s) : ".$infos[idgroupe] ;
         */
         @oci_close($conn);
         return $infos;
     }
 }
开发者ID:jeromecc,项目名称:tuv2,代码行数:53,代码来源:clHopi.php

示例9: DBOracle

 function DBOracle($dbuser, $dbpassword, $dbname)
 {
     $this->dbh = OCILogon($dbuser, $dbpassword, $dbname);
     if (!$this->dbh) {
         $this->print_error("<ol><b>错误:不能建立数据库连接!</b><li>是否输入了正确的用户名和密码?<li>是否输入了正确的主机名?<li>数据库服务器是否运行?<li></ol>");
     } else {
         // 初始化连接属性以备以后选择新数据库使用
         $this->dbuser = $dbuser;
         $this->dbpassword = $dbpassword;
         $this->dbname = $dbname;
     }
 }
开发者ID:chaobj001,项目名称:tt,代码行数:12,代码来源:DBOracle.class.php

示例10: connect

 /**
  *	Function that makes the actual connection.
  *
  *  @returns    Boolean indicating if the connection was succesfull or not.
  */
 function connect()
 {
     if ($this->_conn == null) {
         $conn = @OCILogon($this->_user, $this->_pass, $this->_db);
         if (!$conn) {
             return false;
         }
         $this->_conn = $conn;
         $stmt = OCIParse($this->_conn, 'ALTER SESSION SET NLS_DATE_FORMAT=\'' . $this->_NLS_DATE_FORMAT . '\'');
         @OCIExecute($stmt);
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:18,代码来源:YDDatabaseDriver_oracle.php

示例11: connect

 /**
  *	Function that makes the actual connection.
  */
 function connect()
 {
     if ($this->_conn == null) {
         $conn = @OCILogon($this->_user, $this->_pass, $this->_db);
         if (!$conn) {
             $error = ocierror($conn);
             trigger_error($error['message'], YD_ERROR);
         }
         $this->_conn = $conn;
         $stmt = OCIParse($this->_conn, 'ALTER SESSION SET NLS_DATE_FORMAT=\'' . $this->_NLS_DATE_FORMAT . '\'');
         @OCIExecute($stmt);
     }
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:16,代码来源:YDDatabaseDriver_oracle.php

示例12: db

 function db($dbuser, $dbpassword, $dbname, $dbhost = '', $dbport = '')
 {
     $dbport = $dbport ? ':' . $dbport : '';
     $dbname = $dbhost ? "//{$dbhost}{$dbport}/{$dbname}" : $dbname;
     $this->dbh = @OCILogon($dbuser, $dbpassword, $dbname);
     if (!$this->dbh) {
         $this->print_error("Error", "<ol><b>Error establishing a database connection!</b><li>Are you sure you have the correct user/password?<li>Are you sure that you have typed the correct database instance name?<li>Are you sure that the database server is running?</ol>");
     } else {
         // Remember these values for the select function
         $this->dbuser = $dbuser;
         $this->dbpassword = $dbpassword;
         $this->dbname = $dbname;
     }
 }
开发者ID:benvanstaveren,项目名称:movabletype,代码行数:14,代码来源:ezsql_oracle.php

示例13: connect

 function connect()
 {
     //ïðîâåðêà ñîåäèíåíèÿ ñ ÁÄ
     if ($this->connection) {
         echo "ïîïûòêà ïîâòîðíîãî ïðèñîåäèíåíèÿ ê áàçå äàííûõ";
         return true;
     }
     //if
     $this->con = OCILogon($this->login, $this->psswd, $this->db);
     if (!$this->con) {
         echo "Îøèáêà ïðè ïðèñîåäèíåíèè ê áàçå äàííûõ";
         return false;
     }
     //if
     return $this->con;
 }
开发者ID:sergeykudelin,项目名称:WebDC,代码行数:16,代码来源:db.php

示例14: Connect

 function Connect($conn = '')
 {
     global $dcl_domain_info, $dcl_domain;
     if ($conn == "") {
         if (!defined('DCL_DB_CONN')) {
             $this->conn = OCILogon($dcl_domain_info[$dcl_domain]['dbUser'], $dcl_domain_info[$dcl_domain]['dbPassword'], $dcl_domain_info[$dcl_domain]['dbName']);
             if ($this->conn) {
                 $this->Execute("alter session set NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
                 define('DCL_DB_CONN', $this->conn);
             }
         } else {
             $this->conn = DCL_DB_CONN;
         }
         if (!$this->conn) {
             return $this->ReportError(null, 0);
         }
         return $this->conn;
     }
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:19,代码来源:class.DCL_DB_oracle8.inc.php

示例15: dbconnect

 /**
  * db::dbconnect()		Just connect to DB
  * 
  * @param string $hostName
  * @param string $dbUser
  * @param string $dbPwd
  * @param string $dbName
  * @param string $port
  * @return 
  **/
 function dbconnect($hostName = "", $dbUser = "", $dbPwd = "", $dbName = "", $port = "", $dbType = "")
 {
     global $GonxAdmin;
     if ($hostName != "") {
         $this->hostName = $hostName;
     }
     if ($dbUser != "") {
         $this->dbUser = $dbUser;
     }
     if ($dbPwd != "") {
         $this->dbPwd = $dbPwd;
     }
     if ($dbName != "") {
         $this->dbName = $dbName;
     }
     if ($port != "") {
         $this->hostport = $port;
     }
     if ($dbType != "") {
         $this->dbType = $dbType;
     }
     switch ($this->dbType) {
         case "mysql":
             $this->Link_ID = @mysql_connect($this->hostName, $this->dbUser, $this->dbPwd) or die(_CONNECTION_ERROR_);
             @mysql_select_db($this->dbName) or die(_CONNECTION_ERROR_ . $this->error() . "<br><br>");
             break;
         case "postgresql":
             $this->Link_ID = @pg_connect("host=" . $this->hostName . " dbname=" . $this->dbName . " port=" . $this->db_port . " user=" . $this->dbUser . " password=" . $this->dbPwd);
             break;
         case "oracle":
             $this->Link_ID = @OCILogon($this->dbUser, $this->dbPwd, $this->dbName);
             break;
         case "sqlite":
             break;
         case "mssql":
             $this->Link_ID = @mssql_connect($this->hostName, $this->dbUser, $this->dbPwd) or die(_CONNECTION_ERROR_);
             @mssql_select_db($this->dbName) or die(_CONNECTION_ERROR_ . $this->error() . "<br><br>");
             break;
     }
     // switch
     return $this->Link_ID;
 }
开发者ID:hyrmedia,项目名称:pligg-cms,代码行数:52,代码来源:db.class.php


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