Propel: How the "Affected Rows" Returned from doUpdate is defined
Posted
by Ngu Soon Hui
on Stack Overflow
See other posts from Stack Overflow
or by Ngu Soon Hui
Published on 2009-08-03T09:21:42Z
Indexed on
2010/04/12
8:03 UTC
Read the original article
Hit count: 228
propel
In propel there is this doUpdate function, that will return the numbers of affected rows by this query.
The question is, if there is no need to update the row ( because the set
value is already the same as the field value), will those rows counted as the affected row?
Take for example, I have the following table:
ID | Name | Books
1 | S1oon | Me
2 | S1oon | Me
Let's assume that I write a ORM function of the equivalent of the following query:
update `new table` set
Books='Me'
where Name='S1oon';
What will the doUpdate
result return? Will it return 0 ( because all the Books
column are already Me
, hence there is no need to update), or will it be 2 ( because there are 2 rows that fulfill the where
condition) ?
© Stack Overflow or respective owner