It is narrated from Sayyiduna Anas (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever learns knowledge in order to boast with it before the scholars, or to argue with the foolish by means of it, or to turn people's faces towards himself (that is, to draw people's attention to himself), he is in the Fire."
The wording is the same, except that in al-Nasha'i's narration the words are "or so that he may turn."