PHP Help

I want to create a script that I can use a text box and a query button(just a submit button) to select a character name then bring the stats into respective text boxes.

So If you wanted to look up

Patchwork.

Then hit the submit button

It would output

Patchwork
HP: [Taken from MySQL table for HP]
–Stats–
Str
etc…

I need to know.

How to select those variables like

$str = [str]
$agi = [agi]

and so forth.

I dont want the whole code. I just want help with selecting the MySQL variables and outputting them in HTML