refactor mysql to mysqli

checked whole project with this tool:
https://github.com/philip/MySQLConverterTool