Dear all,
I want to write a script about DB connection error. Who can help me??
e.g. dbx_connect($host, $user, $pwd) or die("connection error");
It works. but I want to redirect a error page if connection error. How do??
BR Steven
Simple: forget the evil 'or die' and use an IF statement:
if (!dbx_connect(bladebla)) { // connect error } else { // connection established };
This will redirect the output to error.php if the function call fails to connect to the database
@dbx_connect($host, $user, $pwd) or header("location: error.php");
Mark http://www.hdwt.com