How do i write a query if the multiple form field data are being searched in mysql database.
The form fields are as follow
FirstName:
LastName:
Age:
Gender:
Now we can enter data in any multiple field and make a search the code i have tried works for single field. Unable to create for multiple conditions
sql = "select * from PERSON where F_Name = %s or L_Name = %s or Age = %s and Gender = %s"
self.cursor.execute(sql,(self.fname, self.lname, self.age, self.gender))
If field FirstName and Gender are filled
If field Lastname, Gender, age are filled
If field FirsName, Age are filled
If field Gender and lastname are filled
like all possible conditions