I have installed wamp server and am working on localhost.I am trying to connect database with following code
<?php
$servername = "localhost";
$username = "";
$password = "";
$database ="weddingapp";
// Create connection
$conn = mysqli_connect($servername, $username, $password);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
mysqli_select_db("$database", $conn);
echo "Connected successfully";
?>
Connected successfully is coming along with error
Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in C:\wamp\www\Wedding-app\config.php on line 13
I am new to PHP help me in this Thanks in advance