NetNerd85's right about the quotes.
We can't tell what's caused your error message because you haven't given us enough information. PHP didn't expect to see a while where it did, so we need to see a couple of lines or so from before it so that we can see what it was reading and work out why it was such a surprise.