Good day, I'm not really familiar with PHP and i get this error when i try to execute my query.
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result,
boolean given in C:\xampp\htdocs\LoginWithMySQLi\products.php on line
'SELECT * FROM users WHERE name = '.$name.' AND usertype = premium';
Your query is not working because you are using string values without quotes:
You can use double quotes for string values as:
$sql = 'SELECT * FROM users WHERE name = "'.$name.'" AND usertype = "premium"';
This is good to see you are using mysqli_* extension, but suggest to use prepared statement this will protect your code for SQL INJECTION, in PDO you can also use PDO Quote function.