Adding functionality im wordpress

I am new here, so don’t know if this is the place to ask this question. So, please be considerate…!

I am developing a site for my project and using wordpress as the CMS in it. I want to add a functionality in it such that when a user enters a code earlier given to them, they are displayed some information stored in a MySql database.

Is it possible in Wordpress?? If yes, how can I do it ?