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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-22-2008, 11:18 AM
Junior Member
 
Join Date: Jul 2008
Posts: 1
Default New to ZF, question about selects

Hi, I've been programming procedurally for years (maintaining legacy apps) but my company is ready to move forward with oop based apps. I'm interested in ZF since I also use Zend Studio and I think some of the framework is built into Studio.

One of the things that concerns me with any framework is loss of capability over existing code. I join tables with many queries and haven't seen any examples of how to do this in ZF. Also, can I specify the fields I need to select or will all be returned (a la SELECT * FROM)

Last edited by pkbarbiedoll : 07-22-2008 at 11:21 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-22-2008, 02:32 PM
Junior Member
 
Join Date: May 2008
Posts: 12
Default

Check out the section of the manual about building select statements. You can do different kinds of joins, and select individual columns to select

Zend Framework: Documentation
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-23-2008, 02:02 AM
dele454's Avatar
Member
 
Join Date: Jun 2008
Posts: 48
Default

Quote:
Originally Posted by pkbarbiedoll View Post
Hi, I've been programming procedurally for years (maintaining legacy apps) but my company is ready to move forward with oop based apps. I'm interested in ZF since I also use Zend Studio and I think some of the framework is built into Studio.

One of the things that concerns me with any framework is loss of capability over existing code. I join tables with many queries and haven't seen any examples of how to do this in ZF. Also, can I specify the fields I need to select or will all be returned (a la SELECT * FROM)
To select individual columns you simply specify those columns in your from() function

e.g
Code:
//create instance of your Db_Table class
//$db is your db adapter
...
$select = $db->select()->from(column1,column2)->where(condition);
...
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:37 AM.