Which PHP version are you using, the mysql_* library has been removed from PHPv7. Also the error is about mysql_query while your code uses mysqli_query, are you sure the error is from this part of the code.
– user1334621Feb 12 at 4:32