|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-10-25 18:37 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 22:00:01 2025 UTC |
//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