Reworked (deprecated) mysql to mysqli.