PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I had a professor in university that would do this - give us some code, not tell us what it's supposed to do, and expect us to fix it. Ya, he wasn't a popular guy. Maybe if you gave us a little more info it'd be easier for us to help. (This is meant in jest..... the part about my professor, not the part about wanting more info).
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
I agree with pickle, but I also don't see anything wrong with it, aside from the fact that your ELSE is totally extraneous. But that won't affect anything. View source.
Then you need to fix your error reporting. You should be getting plenty of information more than that, most especially LINE NUMBERS that would have shown you the problem right away.
You post a code snippet that looks fine, refuse to give the the full error and when you solve the problem don't bother saying what you did. Please read the posting guidelines (first link in my sig).
We are all volunteers here and you are not the only person who needs help, you have to help us help you. You too should think before you type.