Page 1 of 1

problem with ocilogon

Posted: Tue Dec 10, 2002 11:51 am
by kunchesm
<?php
//sample
putenv("ORACLE_SID=intranet");
putenv("ORACLE_HOME=/usr/local/OraHome1");
//putenv("NLS_LANG=THAI_THAILAND.TH8TISASCII");
$iDBConn = OCILogon("ksm", "kusuma");

if(! $iDBConn)
{
echo("can't connet to oracle") ;
}
//PDOB = "24/02/1989" and
$SqlUpdate2CT = "UPDATE T_PERSON SET PID = PID + 10 WHERE PNAME like 'Q%' " ;
$iStatement = @OCIParse($iDBConn, $SqlUpdate2CT);
$arrError = OCIError($iStatement);

if ($arrError['code'])
{
print $arrError['message'];
OCIRollback($iDBConn);
exit;
}

$Update2 = @OCIExecute($iStatement, OCI_DEFAULT);
$arrError = OCIError($iStatement);

if ($arrError['code'])
{
print $arrError['message'];
OCIRollback($iDBConn);
exit;
}

OCICommit($iDBConn);

?>

This code is giving me ..
'Fatal error: Call to undefined function: ocilogon() in c:\myphp\orcl1.php on line 6'
.. I am a newbie .. and i hav just started using database connectivity thru Php .. can anyone guide me .. how to connect to MS Access Databse and Oracle Database.

thanX in advance

Posted: Tue Dec 10, 2002 1:40 pm
by volka
probably the oracle 8 extension is not loaded.
Read http://www.php.net/manual/en/ref.oci8.php
Which distribution do you use? (ORACLE_HOME=/usr/local/OraHome1 suggests it's some kind of unix/kinux/freebsd/...)