Connection timed out php

I cannot connect to my database website tells me this error
image

Code

image

1 Like

You can’t create databases for your scripts via MySQL, even if it does have an inappropriate name for free hosting. You need to create it via the Control Panel in the MySQL section, and define $servername as the MySQL server host that can be found on the Control Panel on MySQL databases and should look like sql123.epizy.com, $username as the username of your account that can be found on the Client Area, $password as the password of your account that can be found on the Client Area, clicking “Show/Hide” to show the password and $dbname as the database name in the structure of username_actualdbname. Then the variable $conn should be a new mysqli object call, with the variables $servername, $username, $password and $dbname. If the connection does throw a connect error (which is not supported on PHP 5.4) the script will throw an error. Don’t forget to close the connection to MySQL after that, with the function close() defined inside of $conn!
Ooh, and you chosen the wrong category, so make sure to post on “Development Support” next time you have PHP issues!

1 Like

Like you don’t even know how much you helped me man I was searching for this for weeks maybe months there is no clear information on google how can I connect to my database or stuff like that.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.