tbl_data
id.............name.............contactID............. location.............specialize
1.............Josh.............1902A .............New York.............IT
2.............Robert...........8291B............. Boston.............Business
3.............Ben.............2893Z ............. Boston.............Marketing
4.............Matt.............X2379............. Beverly Hills.............IT
3 searching option...
- text box with the id keyword (for name or contactID)
- drop down list with the id location (for location). can be proceed without selecting any value.
- drop down list with the id specialize (for specialize). can be proceed without selecting any value.
I did this sql query.
SELECT *
FROM tbl_data
WHERE (name LIKE %Colname1%) OR (contactID LIKE %Colname1%) AND location = Colname2 AND specialize = Colname3
Name: Colname1
Type: Text
Default value: %
Run-time value: $_POST['keyword']
Name: Colname2
Type: Text
Default value: %
Run-time value: $_POST['location']
Name: Colname3
Type: Text
Default value: %
Run-time value: $_POST['specialize']
It is not returning the result as expected. can someone advise me where i go wrong?