problem when connecting to database

Asked

Viewed 37 times

0

Warning: mysqli_select_db() expects Parameter 1 to be mysqli, string Given in C: xampp htdocs lojavirtual conecta.php on line 3 Could not connect

1 answer

0

You must be mixing mysqli with mysql or giving wrong parameter.

Use like this:

$conexao = mysqli_connect("host","usuario","senha") or die ("Erro ao conectar ao banco"); 

mysqli_select_db($conexao, "nome_do_banco") or die ("Banco não encontrado"); 

Browser other questions tagged

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