Hello, i've been tryingt to figure out how to connect to an oracle and i was unsuccessful. Can someone tell me what is wrong with the code below?
<?php
PutEnv("ORACLE_HOME=/usr/local/oracle");
PutEnv("LD_LIBRARY_PATH=$ORACLE_HOME/lib:");
PutEnv("ORACLE_BASE=/usr/local/oracle");
PutEnv("TNS_ADMIN=/afs/umbc.edu/common/etc/tns_admin");
PutEnv("PATH=$ORACLE_HOME/bin:$PATH");
PutEnv("ORACLE_SID=GL");
PutEnv("TWO_TASK=GL");
$connection = Ora_Logon ("username", "password");
if ($connection == false){
echo Ora_ErrorCode($connection).": ".Ora_Error($connection)."<BR>";
exit;
}
$cursor = Ora_Open ($connection);
if ($cursor == false){
echo Ora_ErrorCode($connection).": ".Ora_Error($connection)."<BR>";
exit;
}
$query = "create table email_info " .
"(fullname varchar(255), email_address varchar(255))";
$result = Ora_Parse ($cursor, $query);
if ($result == false){
echo Ora_ErrorCode($cursor).": ".Ora_Error($cursor)."<BR>";
exit;
}
$result = Ora_Exec ($cursor);
if ($result == false){
echo Ora_ErrorCode($cursor).": ".Ora_Error($cursor)."<BR>";
exit;
}
Ora_Commit ($connection);
Ora_Close ($cursor);
Ora_Logoff ($connection);
?>