
April 10th, 2000, 01:57 PM
|
|
Junior Member
|
|
Join Date: Apr 2000
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I'm trying to trap failed connection attempts to my MySQL database. Here's my code:
if (mysql_connect(host, user, password)) {
// Run a query
} else {
$errmsg = "Database unavailable.";
}
Everything works fine, but what happens is that when the code fails (eg, if the mysql service is not running) I get the failed connection message on my webpage, which I DON'T want. Any ideas?
|