CRM-18520 - replace row_count() with affectedRows()