This is no good because it doesn't check for single or double quotes.
Inputting anything with quotes gives ugly ugly errors. Plus, Boolean
interpreters should group quoted words as a single term. It doesn't
check for malicious code input at all. I tried editing it to make it
better, but after lots and lots of work, I didn't get very far. If you
can fix it up, let me know =)
-Original Message-
From: Richard Archer [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 12, 2002 8:04 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP Boolean Interpreter - Need to search a mySQL
database
At 4:50 PM -0400 12/5/02, SpamSucks86 wrote:
I was wondering if anyone knew of any good Boolean interpreters (NOT,
AND, OR, +, -, |, )? I've found three, but they're VERY buggy and I
wouldn't put them into production. Frankly, I don't have the time,
patience, or ability to write a good one from scratch. Here are the
three I've found in case anyone's interested:
http://www.evolt.org/article/Boolean_Fulltext_Searching_with_PHP_and_My
SQL/18/15665/index.html
Thanks for that link... that's a great piece of code!
With error reporting cranked right up it throws a few warnings,
but no errors. It certainly performs as described.
The only thing it doesn't seem to do is check for +.
But adding that is a 30 second task.
If this isn't good enough for you, just what are you looking for?
...R.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php