You've used MySQLi to connect to the database but you used MySQL to run the query. Take note, in PHP, MySQL and MySQLi are different. MySQLi is the newer and improved version of MySQL. So use mysqli_query()
instead of mysql_query
since you've connected to the database using MySQLi.
Hope this helps!