Mysql Question

Hello.

I have created a login system with mysql php and unity and it all works fine.
I know how to retrieve all data from the mysql table with php, but how would i retrieve
a username from the “player’s data”. How do i know who is asking for their username?

Example:

I login with the user name “bob”
now the user name gets saved in the database
but how would i get “bob’s” username out of the database
and not every usernames?. I need “bob’s” specific username?

If you don’t understand what im asking for please let me know!

WHERE username=‘bob’ LIMIT 1 ?

Lets say i want to make it so when a player clicks a button it shows he’s name.

Now i need to go get that name from the database but how do i know who clicked the button?
What am i looking for in the database?

You store your own username in a global variable to be used throughout the game, but this isn’t required in your scenario so far. If you’ve already an open connection to the DB, and you’re retrieving the username of the target, why would you need to know your own username when querying the DB?

Googling “php mysql query” will give you more than enough code snippets to assist in learning PHP, something which I strongly recommend doing before going any further.