The Prophet ﷺ said, "Whoever sets out in the morning to the mosque seeking only to learn something good or to teach it will have a reward like that of a pilgrim whose pilgrimage is complete."
عن النبي ﷺ قال: من غدا إلى المسجد لا يريد إلا أن يتعلم خيرا أو يعلمه كان له كأجر حاج تاما حجته.
No references are available.
Tabarani related it in Al-Kabir (8/111), from Abdan bin Ahmad, who said, Hisham bin Ammar told us, who said, Muhammad bin Shuayb told us, who said, Nur bin Yazid told us, from Khalid bin Madan, from Abu Umama, and he related it.Its chain is hasan because of Hisham bin Ammar, for he is hasan al-hadith.Iraqi said in Takhrij al-Ihya, "Its chain is good."