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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-10-2008, 04:08 PM
Junior Member
 
Join Date: Apr 2008
Posts: 2
Default table update issue

I'm trying to query a database with 'update table set column = column + 1 where...'..

Using zend_db_table I've tried with $table->update(array('column' => 'column+1', $where), but it hadn't worked.

Could somebody help me?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-10-2008, 04:41 PM
Junior Member
 
Join Date: Apr 2008
Posts: 2
Default

I've found out..

the key is to use Zend_Db_Expr.

$table->update(array('column' => new Zend_Db_Expr('column+ 1')), $where);
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 09:20 PM.