I keep getting the error: “Connection timed out” whenever I try to connect to the database on the server, and I was wondering if anyone has advice on how to fix it.
Please check the correct order of the parameters. The mysqli constructor takes the hostname first, then username, password and database name. You provide the database name as first argument, which of course is not a valid database hostname. Moving the DB_NAME to the end should fix the problem.
@Admin said:
Please check the correct order of the parameters. The mysqli constructor takes the hostname first, then username, password and database name. You provide the database name as first argument, which of course is not a valid database hostname. Moving the DB_NAME to the end should fix the problem.