I am building application which needs to have OOP style MySQL query builder. I want to be able to flexibly build complex queries using only PHP and to get resulting query string for execution with my own database driver.
Does anyone know of a good standalone query builder for PHP? Please note that I don’t need database driver I need bare MySQL query builder class (preferably written with camel style function and variable names).
Finally I took Doctrine ORM
and modified it little bit to build SQL instead of DQL.
This works very nice and it able to construct complex queries.
Edit:
You can find my final stable implementation in Stingle framework. Look at Db/QueryBuilder plugin.