Warning: mysqli_query() expects parameter 1 to be mysqli

MySQL queries work fine locally but when uploaded to server. I keep getting the following error from my database connection file. Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in Here is the line the error occurs

list($admin_domain_name) = mysqli_query($db, (“select domain_name from system where site_type = ‘backend’”));

I have set $db as follows:

$db=@mysqli_select_db($connect, $database[‘database’]) or die (“Couldn’t select database”);

You need to remove error suppression (@) and handle them instead (print, log to a file, something). If not you are in tje dark and left with guessing whats wrong

Sponsor our Newsletter | Privacy Policy | Terms of Service