本文整理汇总了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;
}
}
}
示例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);
}
示例3: openConnection
public function openConnection()
{
$ret = 0;
if (!($ret = OCILogon($this->user, $this->pass, $this->base))) {
throw new Exception("Error connect OCI");
}
return $ret;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}