that the Prophet (ﷺ) said: "Whoever learns knowledge for other than (the sake of) Allah…

Jami` at-Tirmidhi Book 41 Hadith 11

Jami` at-Tirmidhi #2655

Chapters on Knowledge 41:11

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."

Chapter: About One Who Seeks The World With His Knowledge

Grade: Da'if (Darussalam)