I already have created my database, and already have the pages in PHP ready to be connected to the database. My code of connection is the follow :
<?php
$host = "localhost";
$db = "clients";
$user = "root";
$pass = "";
$con = mysqli_connect($host,$user,$pass,$db) or die('Could not connect to MySQL: ' .mysqli_connect_error());
?>
When I try to execute the page with WAMP, it returns me the message :
Warning: mysqli_connect(): (HY000/1049): Unknown database 'clients'
Even the database being already created and the queries executed, it still gives me this error, as if the database was with the wrong name in the PHP or something.
Maybe is the error from not having some password from the user root or using localhost ? How can I fix this ?