حَدَّثَنَا أَبُو الرَّبِيعِ، قَالَ: حَدَّثَنَا إِسْمَاعِيلُ بْنُ جَعْفَرٍ، قَالَ: أَخْبَرَنَا الْعَلاَءُ، عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: ”إِذَا مَاتَ الْعَبْدُ انْقَطَعَ عَنْهُ عَمَلُهُ إِلاَّ مِنْ ثَلاَثٍ: صَدَقَةٍ جَارِيَةٍ، أَوْ عِلْمٍ يُنْتَفَعُ بِهِ، أَوْ وَلَدٍ صَالِحٍ يَدْعُو لَهُ.“
It is narrated from Sayyiduna Abu Hurairah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When a servant dies, all his deeds come to an end except for three things (from which he continues to benefit): ongoing charity, knowledge from which benefit is derived, or a righteous (believing) child who prays for him."