2 loops in one script???

Read this: How to Ask Questions the Smart Way

Can you tell us more about what you're trying to accomplish?