started work on the mysql interface, added min and max times to the rest