mysqli_fetch_assoc() expects parameter 1 to be mysqli_result - Google Search[
^]
Only 1.46 million results to choose from!
Or pick any of the "related questions" on the right-hand side of this page to view some of the many many times this question has been asked.
Or try reading the documentation:
Return Values
For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or false
on error.
Also, your code is vulnerable to
SQL Injection[
^].
NEVER use string concatenation to build a SQL query.
ALWAYS use a parameterized query.
PHP: SQL Injection - Manual[
^]