I believe you are confusing AND and OR.
You need an algorithm that lets you easily generate correct SQL from a list of keywords and a list of subjects. It looks like you are heading in that direction.
In reply to Re: Combining two search fields
by pbeckingham
in thread Combining two search fields
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |