[Solved] PHP wont connect to mysql database


If you are getting a connection error, chances are your problem will be found on this line:

$con = mysqli_connect("localhost","username","password","database_name");

Are you sure you have got the correct host address, username, password and name of your database schema?

You may also want to check that you have the mysqli php extension installed on wherever this database is being hosted.

2

solved PHP wont connect to mysql database