PHP class to work with a MySQL database