Save user data to database

I want to save current user details to the database when the user submit a form. How to do it?