Remove deprecated MySQL functions and include MySQLi classes

Removing MySQL functions because they are deprecated. Add in newer MySQLi classes.