I am using an Ajax Search form which upon connecting to the database, will show search terms upon typing.
But I am getting database connection issue on my site.
This is the code I have in my connection file (db.inc):
<?php
$username = "xxxx";
$password = "xxxx";
$hostname = "xxxx";
$database = "xxxx";
mysqli_connect($hostname, $username, $password) or die(mysql_error());
mysqli_select_db($database) or die(mysqli_error());
?>
But on the frontend, I am getting errors as below:
Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in xxxx/db.inc.php on line 9
Warning: mysqli_error() expects exactly 1 parameter, 0 given in xxxx/db.inc.php on line 9
Can anyone please check what I am doing wrong? I have pasted the complete db.inc file above.
Thank you in advance for helping.