How to get data from database?

I use to canvas to build the Users Interface.
I have built a username button for registering
In order not to have the same username case happen
how to write a script to get the data form database and check whether the registers same username?

Thank You. I feel sorry because i am bad at English.

Accessing a database is not really a Unity topic. If you try the forum stackoverflow you might find better help for that matter. Ask again when it comes to feeding the database data from and to Unity UI elements.