11
You also may want to use a ROW_COUNT() function, e.g. -
UPDATE table1 SET column1 = 100 WHERE column2 = 10;
SELECT ROW_COUNT();
From the reference - ROW_COUNT() returns the number of rows changed, deleted, or inserted by the last statement if it was an UPDATE, DELETE, or INSERT...
clamp,
you need to supply a resource to mysql_affected_rows, not a result record. See the links that the others have posted for additional information.
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$result = mysql_query($q);
echo mysql_affected_rows($link);