How do I remove all those annoying error messages PHP puts when errors are recieved? I compiled my PHP with --enable-track-vars. Does this have something to do with it? I took a look at the error_reporting function but it seemed to throw me off.
This is my scenario (to be more precise :-):
I'm opening a mySQL connection with a use-inputted username, password, and hostname. By default, if the information is wrong, PHP complains. I use the mysql_error function to retrieve the last error message, but the PHP standard error system beats me to it and prints out an ugly error message in my html. How do I prevent this?
Also, which peice of code would be better:
$link = mysql_connect("hostname", "user", "password") or die ("Error");
--or--
$link = mysql_connect("hostname", "user", "password");
if(!$link) {
print "you have an error: " . mysql_error() . "\n";
I get that annoying PHP error message when I do the latter of the two. But if I invoke die, it terminates the script without letting me execute any other portion of the code. Can I replace the die function with any other function?
thanks in advance for any help,
-sridhar