How we can use mysql_affected_rows() in stored procedure..
mysql_affected_rows()
You cannot use mysql_affected_rows() in a stored procedure since it's a C API function. You can use FOUND_ROWS() function which gives a similar functionality. Refer this link for more details.
FOUND_ROWS()