I have a database that contains 5 fields that are: name, address, idcard, city, street
Then I have a PHP request that takes one parameter. In this parameter you can enter any fields that you like, and the results should be accurate.
For example, if I enter john doe skate in the search box, you will get all the records whose name is John Doe, and they live on the street known as Skate Street.
Also note that the name is stored in one field in the SURNAME NAME order (I cannot change this because it is necessary, so please do not tell me that it is better to change it ... I know that :)). Obviously, I would like the name to be entered in any order, be it NAME SAMEAME or SAMEAME NAME.
My idea is to first attach the first two parameters entered as a name. I will tell my client that the first 2 parameters should be first and last name, last name and first name. Following the name, he can then enter any of the attributes of the order in any order, for example,
They will be accepted:
name surname idcard town street
surname name idcard town street
name surname town idcard street
surname name address street idcard
They are not accepted:
idcard town name surname street
town name surname idcard
for the simple reason that we make the request too complicated (due to the reason for the name / surname and the fact that they are in the same field)
If there is a way, as the latter is possible without a lot of complications, I would also like to hear it.