Definisci da qualche parte $errores ?

EDIT: Utilizza http://www.php.net/mysql_num_rows al posto di mysql_affected_rows().