Hi
I just need to know which of these two components will be advisable for abstracting your database queries? PHP way or using a database adapter class like PDO_Mysql for query submissions?
Some of the benefits of Zend_Db_Select includes:
- - Automatic quoting of meta-data (table and field names)
- - Object oriented interface can provide for easier maintenance
- - Helps to promote database independent queries
- - Quoting of values to help reduce SQL injection vulnerabilities
Out of all these the most important to me and meets the requirements of my application is 1&4.
Since i dont intend migrating my database to another provider (Oracle/SQL Server) i would like to really to use the Zend_Db_Adapter just for the fact that it accepts strings containing sql statements. I just looks more practical for me. with the Zend_Db_Select though looks a bit more readable requires more lines of typing.
A drawback for me with Zend_Db_Select is that it has NO support for LEFT, RIGHT JOINs, etc. It only supports regular JOINs!!
I also know that with the Adapter i need to quote() all the time for sql injection prevention. Which makes me like Db_Select since it does this autmatically. I feel am divided between both worlds
Is there any performance gain using the Zend_Db_Select as opposed to an Adapter?