Jump to content

Recommended Posts

Posted

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

  • 1 month later...
Posted

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 ->> ***/
?>

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...