merge the mysql part