简体   繁体   中英

Search Multiple Fields from a single form in 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM