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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-14-2007, 01:17 AM
Junior Member
 
Join Date: Aug 2007
Posts: 1
Default Zend_Db_Table and WHERE clause

How would we issue

Code:
SELECT * FROM users WHERE (type='member' or active='1') and level='2'
using Zend_Db_Table?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-14-2007, 10:25 AM
Member
 
Join Date: Aug 2007
Location: Tarnow/Krakow, Poland, EU
Posts: 30
Default

Code:
$table = new Users_extends_Zend_Db_Table();

$where1 = $table->getAdapter()->quoteInto('type = ?', 'member');
$where2 = $table->getAdapter()->quoteInto('active = ?', '1');
$where3 = $table->getAdapter()->quoteInto('level = ?', '2');

$rows = $table->fetchAll('(' . $where1 . ' or ' . $where2 . ') and ' . $where3);
__________________
I don't trust anything that bleeds for five days and doesn't die.
www.inetive.pl
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 02:44 PM.