Mysql class Update

Updated the mysql class since the mysql implementation is deprecated as
of php 5.5 and will be removed in a future version. Also fixed the
implementation errors of the last commit.