ekorenz Posted February 10, 2015 Posted February 10, 2015 User cpanel : ekoxt Server : stevie Domain : ekorenz.us In the past few days my blog there is a problem with the database can not be connected to the server. Please be fixed soon. Thanks
sagnik Posted March 28, 2015 Posted March 28, 2015 You can set "display_errors" and "error_reporting" to "on" to analyse the problem.Like these: <?php ini_set('display_errors', 1); // Displays the errors error_reporting(E_ALL); // Turns on all errors (E_NOTICE, E_WARNING, E_STRICT, ETC) happening on your script $con = mysql_connect("username","password","localhost","user_database") or die(mysql_error($con)); // These will try to connect to database using details. If it couldn't connect then prints the error /*** OTHER THINGS YOU WANT TO DO ->> ***/ ?> After your problem was solved you can turn off Like these: <?php ini_set('display_errors', 0); // Displays the errors error_reporting(E_NONE); // Turns off all errors (E_NOTICE, E_WARNING, E_STRICT, ETC) happening on your script $con = mysql_connect("username","password","localhost","user_database"); // These will try to connect to mysql, if it fails then nothing happens /*** OTHER THINGS YOU WANT TO DO ->> ***/ ?>
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now