Welcome Guest, Not a member yet? Register   Sign In
Affected rows VS Matched rows
#1

[eluser]Alexxz[/eluser]
Quote:$this->db->affected_rows()

Displays the number of affected rows, when doing "write" type queries (insert, update, etc.).
But I have a big problem with it. Because in update query it shows not matched rows, but really affected rows.

Code:
mysql> create table test (a int, b int);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into test values (1, 2);
Query OK, 1 row affected (0.00 sec)

mysql> update test set b = 2 where a = 1;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

Some kind of discussion you can find in php.net site in comments.

Is it possible to make function which returns "Rows matched"? May be User Guide needs correction?
What do you think about this?


Messages In This Thread
Affected rows VS Matched rows - by El Forum - 12-06-2007, 12:57 AM
Affected rows VS Matched rows - by El Forum - 12-06-2007, 01:27 AM
Affected rows VS Matched rows - by El Forum - 12-06-2007, 01:33 AM
Affected rows VS Matched rows - by El Forum - 12-06-2007, 01:40 AM
Affected rows VS Matched rows - by El Forum - 12-06-2007, 01:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB