From:             [EMAIL PROTECTED]
Operating system: windows 2000
PHP version:      4.0.5
PHP Bug Type:     Unknown/Other Function
Bug description:  Oracle connection (cliente Oracle8i 8.1.6.0.0)

//CODE
function ligaGAV() {
//   return odbc_connect("gavdsn","gav_gestor","gestor");
   putenv("ORACLE_SID=gaviao");
   putenv("ORACLE_HOME=d:/orant/");

   echo getenv("ORACLE_SID") . "<br>\n";
   echo getenv("ORACLE_HOME") . "<br>\n";

   $conn = ora_logon("gav_gestor@gaviao","gestor");

   return $conn;

}//end function ligaGAV()

/*
==============================================================================
Funcao: deligaOrcl
Descricao: Recebe o identificador da ligacao Oracle a desligar.
Criacao: 2001-10-25
Autoria: Patricia Albano (TMN)

==============================================================================
*/
function desligaOrcl($idLig) {
   //odbc_close($idLig);
   ora_logoff($idLig);
}//end function desligaOrcl


function contaReclamacoes() {

   $odbcOrcl = ligaGAV();

   if ($odbcOrcl) {
      echo "Ligacao ORCL<br>\n";

      $cur = ora_do($odbcOrcl,"SELECT COUNT(*) FROM gareclamacao");
      if ($cur) {
         echo ora_getcolumn($cur,0);
      } else {
      }


   } else {
      echo "ERRO: " . ora_errorcode($odbcOrcl) . " - " .
ora_error($odbcOrcl) . "<br>\n";
   }//end if ($odbcOrcl)

   desligaOrcl($odbcOrcl);
}
-----------------------------------------------------------~
Extension php_oracle.dll instaled

Problem: first time the script is runned with Apache, there is no problem.
Second time I get: 
Warning: Oracle: Connection Failed: ORA-12154: TNS:could not resolve
service name in d:\program files\apache
group\apache\htdocs\indicadores\includes\trataorcl.php on line 29

Warning: Supplied argument is not a valid Oracle-Connection/Cursor resource
in d:\program files\apache
group\apache\htdocs\indicadores\includes\trataorcl.php on line 63

Warning: Supplied argument is not a valid Oracle-Connection/Cursor resource
in d:\program files\apache
group\apache\htdocs\indicadores\includes\trataorcl.php on line 63
ERRO: - 

Warning: Supplied argument is not a valid Oracle-Connection resource in
d:\program files\apache
group\apache\htdocs\indicadores\includes\trataorcl.php on line 44

-- 
Edit bug report at: http://bugs.php.net/?id=13826&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to