If example my i cannot connect to database and i want this error message insert into a log file and send as error email notification how?
say i got this
$dbLink = mysql_connect(ip, username,password);
if(!$dbLink) die("Could not connect to database. " . mysql_error());
if say the username is incorrect that mean could not connect to database
how can i send this error message to log file and an email?