Thanks!
How about doing something like this?
what I'm trying to understand is what would be the difference between your method and the following one?
$dbconnection = @mysql_connect('localhost'
if (!$dbconnection) {
?>
<div align="center" style="font-family:'Times New Roman', Times, serif; font-size:16px">
Unable to connect to the database server at this time. Please contact your Administrator or try again.
</div>
<?php
exit();
}
if (!@mysql_select_db('myDb')
?>
<div align="center" style="font-family:'Times New Roman', Times, serif; font-size:16px">
Unable to locate the myDb database at this time.
</div>
<?php
exit();
}
Main Topics
Browse All Topics





by: al3cs12Posted on 2009-03-09 at 17:06:02ID: 23842507
As you said exceptions are mainly used for objects, but for procedural code you can use ErrorException to replace the standard notices/warnings
Select allOpen in new window