Perl database Search
Posted on 2005-03-02
Here is my Problem:
I have a database with several fields (price,addcontents,dateadvertised etc), i need to be able to search addcontents in conjunction with others like dateadvertised.
My input will be a string like any of the following "holden statesman", "holden AND statesman", "holden OR statesman", ''holden NOT statesman". It may contain any number of criteria for example "holden AND statesman NOT barina" etc. (sort of like a web search)
I need to break the string into parts and search through the addcontents field for any matches. The keywords AND, OR, NOT need to be used in order to determine if the search is a union or an intersection etc. The default if no keyword is specified is AND.
I need this to fit into an sql query with other criteria eg: "SELECT * FROM carAdds WHERE dateadvertised<$somedate AND TheNewSqlCriteria What ever it is.
I think that makes the problem clear. Any help or further questions pls post and i will respond.