@John Joe - You could have let the OP try debugging the code before giving the answer.
Can you explain to the OP how you found the problem?
It's important to know how to debug code and find the problem by yourself.
--- Update ---
@John Joe - You could have let the OP try debugging the code before giving the answer.
Can you explain to the OP how you found the problem?
It's important to know how to debug code and find the problem by yourself.
--- Update ---
i tried but i think I'm missing something
Please post the code that shows what you did and why you think you are missing something.