How to create login and registration system using object oriented concept?

I want to create a login scene for my game. At first player need to register a account then he/she can login to the game. In login page there is only two input field one is "username’ another is “password”. There is a option for registration. If player click on “Registration” button its open registration page. Where player need to submit name, username, password, repassword. After complete registration it will be back to login page. Then if login complete then game page will be open.

Blockquote

Now the problem is I want to do this using database(localhost) and object oriented programming concept.

Blockquote

@milleniu can you help me?