Well now my go.
I have done something very very similar.
No you cannot have the code. It is MUCH MORE FUN it you work it out for your self.
For a start something that the previous posters forgot, what happens if more than one matching row is found (i.e. only the 'Sex' field was filled in?
The previous examples show HTML forms being used. I would suggest that you look at text boxes and handle the input / display using javascript and good old (new?) AJAX. Remember fields do not have to exist when the page is first displayed on the client screen. the DOM allows you to create objects, and set their values and all other properties on the fly.
QUICK TIP use different text areas for user input and data display, when the user submits some data expect it to be partial data and leave the focus in the same fiedl that the user last used. If the user submits "Pat" and you list out all of the Pat's / Patricia's & Partick's that you can find, the user will find it much easier to go on to finish Patraig.
I would recommend you get 'THE JAVASCRIPT BIBLE'. It contains a huge amount of information and will guide you through your first steps in implementing this type of function.