I connect to the Mysql database from localhost, everything is fine ... And it doesn't work on the server ... And there are no errors, and the script (php) does not work anymore. Hosting the database from one host, and hosting the site is very, very different ...

Question: This (different hosting) can cause the inoperability of the script? Already a day killed ...

I solved the question - as I understood, there was no mysqli driver on the server, there were no such problems with PDO!

  • Does not work, but there are no errors? A script for some reason does not work anymore. In both! Enter error_reporting(E_ALL) at the very beginning of the script and errors will come out into the light. And remove the @ before the variables. To connect to MySQL, you need to specify exactly the parameters that the hoster and indicates to connect. I hope you have in the script, which is "on the server", localhost not entered, as the host for the connection (since the base is in a different place)? - void
  • error_reporting (E_ALL) - entered ... @ - no ... I’m writing without them ... parameters for connecting from a hoster ... localhost is not entered, since I immediately connected to the server, and from the computer too ... - Mike

1 answer 1

It may not work for itself. The hoster of the database at least can NOT accept requests from outside, for example, the database is configured so that it listens only to localhost. It may be that connections on this port are closed by a firewall.