Changed from mysql to mysqli