Add register function with mysql database