Answer the question
In order to leave comments, you need to log in
Can't connect to php database?
I can't help you figure out why. Error: Undefined variable: mysqli_connect_errno
<?php
$mysqli = new mysqli('localhost','root','','test');
if ($mysqli_connect_errno()){
echo ("подключение невозможно!".mysqli_connect_error());
}
else{
echo ("Вы успешно подключились");
}
$mysqli->close();
?>
Answer the question
In order to leave comments, you need to log in
And now the correct answer .
At the very least, you should write like this:
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli('localhost','root','','test');
$mysqli->set_charset('utf8mb4');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question