Catch database connection exception
|
<?php
try { $conn = mysql_connect("localhost","username","password"); if (! $conn) { throw new Exception("Could not connect!"); } } catch (Exception $e) { echo "Error (File: ".getFile().", line ".$e->getLine()."): ".$e->getMessage(); }
?>
|
|
|
|
|
HTML code for linking to this page:
Related in same category :
-
|