problem connecting to database [duplicate]

0

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

    
asked by anonymous 27.11.2017 / 04:43

1 answer

0

You should be mixing mysqli with mysql or reporting wrong parameter.

Use 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"); 
    
27.11.2017 / 05:22