how to use input from text_field via a button..?

Hi,

This is most likely trivial but I cannot find it anywhere... I have a
text_field and a button. I would like to use the input in the
text_field as a value to compare against a column in a mySQL database
that's not the id (call it 'name'). How can I do this?

Thanks for any help.