On Sun, Mar 29, 2009 at 3:56 AM, Thomas Shaw <[email protected]> wrote:
> Sorry I should have stated the problem more precisely. Using Zend_DB_Table I
> ran into two problems the first parameter the associative array of values, I
> wanted to update the field by it's own value + 1 like
> field = field + 1. The second parameter I need to add AND conditions to
> narrow down the update. I'm un sure if the update method supports this at
> this time the manual does mention "the second argument can be an array of
> SQL expressions. The expressions are combined as Boolean terms using an AND
> operator." If this is the case there's not much documentation describing how
> to do this. Plus is there any way to do a comparison BETWEEN using either
> the select or update methods?
I don't know know about BETWEEN, maybe grep through the code to check
if it's in there. ;-)
>
> // Is this allowed?
> $data = array(
> 'field' => 'field + 1',
> );
Try Zend_Db_Expr:
$data = array('foo' => new Zend_Db_Expr('foo + 1'));
Till