in reply to Record Count

This is a total nitpick, but for the sake of people who may have to maintain your code later, you might want to spell "referrals" correctly in your db field names. It's one f, two r's (well, three if you count the initial r). Happy coding!