Use $rs->records(), with $return_records==0, instead of $rs->record()