Driver Error

Shadow121

Member
Messages
901
Reaction score
0
Points
16
I was wondering how i could do something like how IPS did with invision board where if somethings messed up it'll show IPB Driver Error so far i have:

PHP:
<?php
$config[host] = "localhost";
$config[user] = "root";
$config[pass] = "PaSsWoRd1634735";
$config[data] = "sys";

if(mysql_error()){
die("<h1>Error</h1><p>There Seems To Be An Error Please Click <a href=\"$_SERVER[PHP_SELF]\">Here</a> To Refresh And Try Again");
}else{
mysql_connect($config[host], $config[user], $config[pass]);
mysql_select_db($config[data]);
}
?>

But it don't work.
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Try

PHP:
 <?php
$config[host] = "localhost";
$config[user] = "root";
$config[pass] = "PaSsWoRd1634735";
$config[data] = "sys";

mysql_connect($config[host], $config[user], $config[pass]) or 
die("<h1>Error</h1><p>There Seems To Be An Error Please Click <a href=\"$_SERVER[PHP_SELF]\">Here</a> To Refresh And Try Again");
mysql_select_db($config[data]) or 
die("<h1>Error</h1><p>There Seems To Be An Error Please Click <a href=\"$_SERVER[PHP_SELF]\">Here</a> To Refresh And Try Again");
?>
</span> </span>
 

Shadow121

Member
Messages
901
Reaction score
0
Points
16
That works though it shows the mysql_connect and the database error so i added @ before them.
 

dharmil

New Member
Messages
1,656
Reaction score
0
Points
0
PHP:
<?php
$config[host] = "localhost";
$config[user] = "root";
$config[pass] = "PaSsWoRd1634735";
$config[data] = "sys";
error_reporting(0);
mysql_connect($config[host], $config[user], $config[pass]) or 
die("<h1>Error(".mysql_error().")</h1><p>There Seems To Be An Error Please Click <a href=\"$_SERVER[PHP_SELF]\">Here</a> To Refresh And Try Again");
mysql_select_db($config[data]) or 
die("<h1>Error(".mysql_error().")</h1><p>There Seems To Be An Error Please Click <a href=\"$_SERVER[PHP_SELF]\">Here</a> To Refresh And Try Again");
?>
 
Top