in reply to Parsing a boolean search string for SQL query
It would be much simpler to work the other way round, i.e. by replacing all query terms 'x' by 'fieldname = x'. This would mean something like:
s/(\w+)/$1 ne 'OR' && $1 ne 'AND' && $1 ne 'NOT' ? "fieldname = '$1' +" : $1/eg;
Hope this helps, -gjb-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Parsing a boolean search string for SQL query
by bradcathey (Prior) on Sep 01, 2003 at 18:19 UTC |