All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
It might be that you are referring to the narration reported by Ibn Maajah that Abu Tharr narrated: "The Prophet told me: "O Abu Tharr, if you go to the mosque in order to memorize one verse from the Book of Allaah, it is better for you than performing 100 Rak'ahs, and if you go to the mosque in order to learn a chapter of knowledge whether or not you act upon it, is better for you than performing 1,000 Rak'ahs." The outstanding scholar, Al-Booseeri said: 'The chain of narrators of this narration is weak.' Moreover, Al-Albaani classified this narration as weak.
Allaah Knows best.