Hello all, I have recently been working with OCI and when I use OCILogon
[wethere with example scripts or my own code] I get a "PAge cannot be
displayed" (like DNS error) when I naviagte to the page. When I comment
out the OCILogon part it works great exept for the oracle part. I am able
to accesss the database from Perl, the built in SQL*PLUS and other
languages.- The only problem is this. I have to have this working by
friday morning and I cannot risk not mailing this alias; so please any
help is greatly appreciated!!
Here are my code snippets:
dbconnection.php
<?php
class OracleConnection
{
var $CONN = "";
var $IPADD = "*.*.*.*";
var $USER = "****";
var $PASS = "********";
var $SID = "****";
function fatal_error($text)
{
$maillink = '<a href="mailto:[EMAIL PROTECTED]">network administrator</a>';
echo "<b>Fatal Error. </b><br>";
echo "[$text] ( 0 : 0 ) <br>";
echo $_SERVER['HTTP_USER_AGENT'];
echo "<br>";
echo "ORACLE_SID: ".getenv("ORACLE_SID")."<BR>ORACLE_HOME:
".getenv("ORACLE_HOME"."<BR>";
$error = OCIError();
if ($error["offset"])
{
$sqltext = substr ($error["sqltext"], 0, $error["offset"]) . '*' . substr ($err
($error["sqltext"], $error["offset"]);
}
else
{$sqltext = "No OCI error.";}
echo $sqltext;
echo "<BR>Contact the $maillink with this message.\n";
exit;
function init()
{
putenv("ORACLE_SID=PROJ");
putenv("ORACLE_HOME=/home/oracle9");
$ipadd = $this->IPADD;
$user = $this->USER;
$pass = $this->PASS;
// $dbase = $this->DBASE;
// $dbase = $DBAC_BEGIN . $DBAC_PROTO . $DBAC_HOST . $DBAC_PORT . "))" . $DBAC_COTD
. ")";
$dbase = "(DESCRIPTION=(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST =
128.*.*.*)(PORT = 1521)))(CONNECT_DATA=(SID=PROJ)))";
// use for PHP 5.0 and greater
// $conn = oci_connect($user, $pass, $dbase) || $this->fatal_error("Connection
could not be established with server [$ipadd]");
// use for PHP 4.91 and lower
$conn = ociplogon($user, $pass, $dbase) || $this->fatal_error("Connection could
not be established with server [$ipadd]");
$this->CONN = $conn || $this->fatal_error("Connection could not be stabalized,
unable to continue.");
return true;
}
//end class: 'OracleConnection'
}
--eof--
Also, could someone please send me a working example of using variables
appended to text with "array()"? I am a long time experienced perl
programmer and I have tried using the . operatore a + but no luck.
Thanks everyone!!!
Please excuse types, typing on a 14.4 connection.
-------------------------------------------------------------------------------
Charles Morris
[EMAIL PROTECTED]
CS Systems Group Old Dominion University
http://www.cs.odu.edu/~cmorris
http://www.cs.odu.edu/cspage/systemstaff.html
------------------------------------------------------------------------------
They that give up essential liberty to obtain
a little temporary safety deserve neither
liberty nor safety. -- Benjamin Franklin, 1759
The only secure computer is one that's unplugged, locked in a
safe, and buried 20 feet under the ground in a secret location...
and i'm not even too sure about that one"--Dennis Huges, FBI.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php