Error connecting php database

0

Hello good afternoon I have an error with my system is that I am changing to PHP 5.6 to 7.1 I get that error when I want to connect my database and I have no idea why I leave the source code here

@$conectar = mysqli_connect($dbhost,$dbuser,$dbpassword);

// check the connection
if (!$conectar){
die(include ("500.php"));
}


/* User datos */

$bdselect = mysqli_select_db($dbdatabase,$conectar);

if (!$bdselect) { 
die(include ("500.php"));
}
  

Warning: mysqli_select_db () expects parameter 1 to be mysqli, string given in C: \ xampp \ htdocs \ new \ connectbd.php on line 17

     

Notice: Undefined variable: bdselect in C: \ xampp \ htdocs \ new \ connectbd.php on line 19

    
asked by Shareiv 13.09.2017 в 19:21
source

1 answer

1

In this line $bdselect = mysqli_select_db($dbdatabase,$conectar); the variable $conectar must go as the first argument. That tells you the error expects parameter 1 to be mysqli but you're sending a string $dbdatabase

    
answered by 13.09.2017 / 19:24
source