ROW_COUNT()
ROW_COUNT()
This function returns the number of rows changed by the
previous SQL statement executed. If the previous statement was not one
that could potentially change data rows—in other words, it wasn’t an
INSERT, UPDATE,
DELETE, or other such statement—this function will return –1. Here is an
example:
SELECT ROW_COUNT(); +-------------+ | ROW_COUNT() | +-------------+ | 4 | +-------------+
The results here show that four rows were changed.