mysql_affected_rows()

It  returns the number of affected rows in the previous MySQL operation.

Example

<?php
$con = mysql_connect(“localhost”,”root”,”password”) or die( mysql_error());
mysql_select_db(“databse_name”);
mysql_query(“DELETE FROM table_name WHERE id = 1”);
echo mysql_affected_rows();
mysql_close($con);
?>