Update mysql_* methods and tidy