Does anyone have a good function for parsing a search string into SQL?  I
know it will depend on the name of the field and table I'm searching
through.  Anything close will be helpful.  An example search string would

beer AND pizza NOT anchovies

and the resulting search string would be

select ID, Title from Products where Title like '%beer%' AND Title like
'%pizza%' AND Title NOT LIKE '%anchovies%';

Another example search string would be:

beer OR pizza AND movies

Thanks! =)


This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to