I have several different filters and search functions that I need to generate mysql queries for. I am wondering if there is a class or library I can use.
For example if they input there email with a date I need to add WHERE email='email' AND date`=’date’ in the middle of the sql query. But if they also enter a city then I need to add that.
I was thinking put everything I need to search by in an array and then imploding it by AND ? Does anyone have any better suggestion?
I use Zend_Db for that sort of thing. Quick example, using Zend_Db_Select: