There are a bunch of different ways to do this. If your way works, I wouldn't worry too much about it.
But if you're just curious about alternative approaches, the first thing that occurs to me is...
Type: Posts; User: KevinWorkman
There are a bunch of different ways to do this. If your way works, I wouldn't worry too much about it.
But if you're just curious about alternative approaches, the first thing that occurs to me is...
Are you asking us how to do this (if so what are you confused about?), or are you asking us to critique your code (if so can you post your code?)?