حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ نُمَيْرٍ، عَنْ مُوسَى بْنِ عُبَيْدَةَ، عَنْ مُحَمَّدِ بْنِ ثَابِتٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ كَانَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ يَقُولُ ‏"‏ اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي وَعَلِّمْنِي مَا يَنْفَعُنِي وَزِدْنِي عِلْمًا وَالْحَمْدُ لِلَّهِ عَلَى كُلِّ حَالٍ وَأَعُوذُ بِاللَّهِ مِنْ عَذَابِ النَّارِ ‏"‏ ‏.‏

It was narrated that Abu Hurairah said: "The Messenger of Allah (saas) used to say: 'Allahummanfa'ni bima 'allamtani, wa 'allimni ma yanfa'uni, wa zidni 'ilman, wal-hamdu lillahi 'ala kulli hal, wa a'udhu billahi min 'adhabin-nar (O Allah, benefit me by that which You have taught me, and teach me that which will benefit me, and increase me in knowledge. Praise is to Allah in all situations, and I seek refuge with Allah from the torment of the Fire).'" Translation Not Available

Book reference: Sunan Ibn Majah Book 34 Hadith 3833
Web reference: Sunan Ibn Majah Volume 5 Book 34 Hadith 3833