Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-17-2008, 12:56 PM
dele454's Avatar
Member
 
Join Date: Jun 2008
Posts: 48
Default Zend_Db_Select or Zend_Db_Adapter

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:
  1. - Automatic quoting of meta-data (table and field names)
  2. - Object oriented interface can provide for easier maintenance
  3. - Helps to promote database independent queries
  4. - 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?

Last edited by dele454 : 07-17-2008 at 01:21 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-17-2008, 02:31 PM
Senior Member
 
Join Date: Jun 2008
Location: Florida
Posts: 108
Default

What about join(), joinLeft(), joinRight(), joinFull(), joinCross(), joinNatural?
Zend Framework: Documentation
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-18-2008, 05:08 AM
dele454's Avatar
Member
 
Join Date: Jun 2008
Posts: 48
Default

Quote:
Originally Posted by jweber View Post
What about join(), joinLeft(), joinRight(), joinFull(), joinCross(), joinNatural?
Zend Framework: Documentation
Thanks i was reading a Q&A session from a webinar and it was stated there. I thought it was a recent one apparently it was for ZF1.1. Indeed it does support varied join constructs. Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:41 AM.