Answer the question
In order to leave comments, you need to log in
PHP script can't connect to MySQL when running from console and web server with the same settings?
The connection string looks like this:
$mysqli = new mysqli('localhost:3306', "user", "pass", "db");
$mysqli = new mysqli('localhost', "user", "pass", "db");
Answer the question
In order to leave comments, you need to log in
I'm a moron: these are different php being launched, which is why, apparently, the fakap.
No, guys, that's not going to work. We don’t even bother to look at the documentation before writing such questions.
Are you used to what is indicated everywhere in the form of host: port? Nope.
$mysqli = new mysqli('localhost', "user", "pass", "db", 3306);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question