Hi,
I have a database which contains 5 fields, which are: name, address, idcard, town, street
I then have a PHP query which accepts one parameter. In this parameter, you can enter whatever fields you like and the results must still be accurate.
For example, if I enter john doe skate street in the search box you will get all the records whose name is John Doe and they live in the street known as Skate Street.
Also, please note that the name is stored in one field in the order SURNAME NAME (I cannot change this because this is a must so please don't tell me that its better to change it... I know that :)). Obviously, I would like that the name can be entered in any order, be it NAME SURNAME or SURNAME NAME.
My idea is to first attach the first two entered parameters as the name. I will tell my client that the first 2 parameters must be the name and surname or surname and name. Following the name, he may then enter any of the order attributes in whatever order he likes, i.e.
These will be accepted:
name surname idcard town street
surname name idcard town street
name surname town idcard street
surname name address street idcard
These will not be accepted:
idcard town name surname street
town name surname idcard
for the simple reason that we will complicate the query too much (because of the name/surname reason, and them being in the same field)
If there is a way how the latter is possible without a lot of complications, I would like to hear it as well.
I would appreciate some help on this matter
Many thanks in advance