ERROR WHEN SELECTING THE DATABASE

Asked

Viewed 126 times

-6

Warning: mysqli_select_db() expects Parameter 1 to be mysqli, string Given in C: Users wesle Onedrive Images New htdocs MOBILE folder db.php on line 3 FAILURE TO SELECT THE DATABASE

$connect = mysqli_connect("localhost", "root", "") OR DIE("FALHA AO CONECTAR AO SERVIDOR");
$db = mysqli_select_db("sitefitflix", $connect) OR DIE("FALHA AO SELECIONAR A DATABASE");

1 answer

1

See if it helps:

$sql["host"] = "localhost";
$sql["usuario"] = "seu usuario do banco dados";
$sql["senha"] = "sua senha do banco dados";
$sql["base"] = "nome do seu banco de dados";
$conexao = mysqli_connect($sql["host"],$sql["usuario"],$sql["senha"]);
$select_database = mysqli_select_db($conexao, $sql["base"]);
mysqli_query($conexao, "SET NAMES utf8");

Browser other questions tagged

You are not signed in. Login or sign up in order to post.