Don't try to limit a query that gets the total number of rows

Plus since $data wasn't passed in here it could never have worked anyway.