Anas bin Malik reported,

The Messenger of Allah ﷺ said, "Seeking knowledge is an obligation upon every Muslim, and the one who places knowledge with those unworthy of it is like one who adorns swine with jewels, pearls, and gold."

Ibn Majah 224

Daif

حدثنا هشام بن عمار حدثنا حفص بن سليمان حدثنا كثير بن شنظير عن محمد بن سيرين

عن أنس بن مالك قال

قال رسول الله ﷺ طلب العلم فريضة على كل مسلم وواضع العلم عند غير أهله كمقلد الخنازير الجوهر واللؤلؤ والذهب

ابن ماجه 224ضعيف
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Sunnah
Chapter
Virtue of scholars and the encouragement to seek knowledge
Numbering
Darussalam 224
Ibn Majah 224