I'll reveal the answer to the puzzle in this post here.
When the bartender asks the first of the philosophers whether all of the philosophers will have a beer, he can only speak for himself. He'd like to have a beer but he can't know about the other two who haven't answered the question, yet, so he answers that he does not know. If he did not want a beer, he'd know for sure that not all of them wanted a beer and his answer would be negative. Ditto for the second philosopher.
Because the third philosopher heard the first two answers to the question, he knows that they each wanted to have a beer. Because he knew he wanted one, he was able to give a positive answer to the question.