You're mixing traditional PHP MySQL functions mysql_*
with the MySQLi interface. In this case, mysql_fetch_assoc()
expects a resource handle created with mysql_query()
.
To retrieve the correct result, you'll need to use MySQLi's method:
$row = $result->fetch_assoc();
And while you're at it, you might want to consider making the code less susceptible to MySQL injection. Properly escape any user provided input before interpolating it into a query string, or better yet, use MySQLi parameter binding facilities.
No comments:
Post a Comment