MySQLi Affected vs Matched
Posted: Fri Aug 12, 2011 1:03 pm
I'm having an issue with mysqli->affected_rows.
Here's my example table:
Name, Age
John Doe, 26
Bob Doe, 35
And here's my example update statement:
UPDATE table SET Age = 26 WHERE Age > 0;
Running the UPDATE and displaying mysqli->info gives me: "Rows matched: 2 Changed: 1 Warnings: 0".
I can call mysqli->affected_rows to return the Changed value. However, I want to know the Matched value. Is there a way to get the Matched value (aside from parsing the mysqli->info string)?
Here's my example table:
Name, Age
John Doe, 26
Bob Doe, 35
And here's my example update statement:
UPDATE table SET Age = 26 WHERE Age > 0;
Running the UPDATE and displaying mysqli->info gives me: "Rows matched: 2 Changed: 1 Warnings: 0".
I can call mysqli->affected_rows to return the Changed value. However, I want to know the Matched value. Is there a way to get the Matched value (aside from parsing the mysqli->info string)?