You removed the MySQL recordset from the page, and replaced it with a MySQLi recordset, however, there where a number of places where the old MySQL recordset was being referenced causing errors in the page.
I replaced those instances with the code for the MySQLi recordset to fix the problem.