in reply to If Problem!!!

Looks like a problem with while, not if. Check your SQL query.