Hints
Within the same transaction both requires should run. Then will return proper affected rows. This is same as php affected_rows() method works. Running in different transaction returns zero.
Run it in the stored procedure to make single transaction result by row_count() method.
|
Use ROW_COUNT() for Getting No of Affected Rows
ROW_COUNT() method returns no of rows affected by insert, update or delete queries. ROW_COUNT method is same as mysql_affected_rows() method in PHP.
|
INSERT INTO user_info VALUES("Raja"),("John"),("Siva");;
SELECT ROW_COUNT();
DELETE FROM user_info WHERE user_name IN ("Raja","John","Siva");
SELECT ROW_COUNT();
|