Jami` at-Tirmidhi, Book 41, Hadith 11 (Tirmidhi 2725)

Narrated Ibn 'Umar:

that the Prophet (ﷺ) said: "Whoever learns knowledge for other than (the sake of) Allah, or intends by it other than Allah, then let him take his seat in the Fire."