chaiwat update function login & data base