Switched from mysql library to mysqli