phpmysqlezsql

php CRUD passing parameters


I'm working on a php service. I'd like to pass an object with the parameters to use in the "where" clause and also the "order" and "limit" params.

I'm wondering whether there is a standard way/library to make up the query based on the parameters given, or whether I'll need to roll one.

I'm using ezsql to connect to mysql.

Any pointers, much appreciated.


Solution

  • Writing one yourself shouldn't be too hard. If you don't want to do so (DRY, right?), you may check out sites like phpclasses.org or use an abstraction layer from Doctrine (take a look at its QueryBuilder if it is what you need)