在php中搜索单个表单中的多个字段

I have the following records

first name    last name   id
----------    ---------   ---
John           Doe        68
Jane           Doe        69

and I have single search box. What I'm trying to do is a search from a single form box.

For example, the user will type in the last name Doe and all instances of Doe will show up.

How would I go about creating a search function that will split the data and search the correct field based on the data that is based on the input.

Thank you

Ok, I found the solution myself and here is what I did.

  1. I put the search item as an array.
  2. I put the values of the parameters in a for loop in the query