It was narrated from Ibn 'Umar that:
The Messenger of Allah said: "Whoever seeks knowledge in order to argue with the foolish, or to show off before the scholars, or to attract people's attention, will be in Hell." (JA)
English reference (JA): Vol. 1, Book 1, Hadith 253 (JA)
Arabic reference (JA): Book 1, Hadith 262 (JA)