In PHP, how would i construct an sql to search for a record with conditional statements?
Say i have two fields, firstname and surname, and user can enter
into a form to search for a record
So the form posts its values
Instead of having to write 3 "if-else" options to cater for the fields that a user may have input, incase i then increase this to include middlename, etc which would create a longer "if-else" statement with all the possible combinations
How can i make it such that -
SELECT * FROM user WHERE ......
caters for such scenarios?