1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
try
{ $this->idConn = mysql_connect($this->dbHost,$this->dbUser,"zut") ;
if ($this->idConn)
{ // Une connexion est établit on sélectionne notre BD
$this->selectDB();
}//end if
else
throw new Exception("Couldn't connect to database") ;
} catch(Exception $E)
{
// print_r($E) ;
$T = $E->getTrace() ;
print_r($T) ;
/* Resultat du print_r($T)
Array ( [0] => Array ( [file] => F:\WebSites\test\index.php
[line] => 456
[function] => connect
[class] => MySQL
[type] => ->
[args] => Array ( ) ) ) Message: Couldn't connect to database - File: F:\WebSites\test\index.php - Line: 216
*/
Les instructions en bleus sont bien exécutées !
print( "Message: " . $E->getMessage() . " - File: " . $E->getFile() . " - Line: " . $E->getLine() . "<br>\n") ;
print("Trace: " . "<br>\n") ;
print( " => File : " . $T[0][file] . "<br>\n" ) ;
print( " => calling instruction: " . $T[0][line] . "<br>\n" ) ;
// print( " => error class : " . $T[0][class] . "<br>\n") ; 238
print( " => error function : " . $T[0][function] ) ; |