Rohit83 wrote:
> 
> Hi All,
> I use update() function like
> $n = $db->update('bugs', $data, 'bug_id = 2');
> but when this function executes all the rows in the table changes to the
> value i have passed to update function instead of only one row that i have
> given in the function.
> This is bug or i am using function wrongly ?
> 

That is the usage of the update() method.  The first argument is the table
name, the second is an associative array of column names to values, and the
third argument is an expression that will be used in the WHERE clause.  

If your expression in the third argument evaluates to true for all rows,
this would explain why the update is being applied to all rows.

The code you show above is the example out of the manual.  I assume your
actual code and database structure is different.  So I can't tell why your
code is acting the way it is.

Regards,
Bill Karwin
-- 
View this message in context: 
http://www.nabble.com/Updating-Data-using-update%28%29-function-tp18731318p18738050.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to