• Please, don't go step by step.

    You have 3 posts very similar and it seems to me that you're not giving us the entire problem.

    If we're aware of the whole context, we can give you better ideas.

    PS. I'm glad you liked my solution, a simple thanks would have been appreciated.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2