code for database from mySQL