added var $rows_affected = false;