Someone told me that it is not good to pray with an empty stomach. He told me I should open my fast and then pray. Is that right? Should I eat before doing my maghrib prayer? What order did rasulAllah follow?
There are some reasons why one should not pray while hungry, the one that I know of is because when you pray and you are hungry than you can not concentrate in the salat properly. The Prophet (Peace be Upon Him) said that one should hasten to break their fast as the following Hadith tells us (from Sahih Bukari ) :
Narrated Sahl bin Sa`d:
Allah's Apostle said, "The people will remain on the right path as long as they hasten the breaking of the fast."
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ يُوسُفَ، أَخْبَرَنَا مَالِكٌ، عَنْ أَبِي حَازِمٍ، عَنْ سَهْلِ بْنِ سَعْدٍ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ " لاَ يَزَالُ النَّاسُ بِخَيْرٍ مَا عَجَّلُوا الْفِطْرَ ".
One should only break fast before Maghrib salat but not eat dinner, you break your fast with fresh fruit, the sunnah is to break fast on Dates:
Anas (May Allah be pleased with him) reported: The Messenger of Allah (sallallahu 'alaihi wa sallam) used to break his Saum (fasting) before performing Maghrib prayer with three fresh date-fruits; if there were no fresh date- fruits, he will eat three dry dates; and if there were no dry date- fruits; he would take three draughts of water.
وعن أنس رضي الله عنه قال كان رسول الله صلى الله عليه وسلم يفطر قبل أن يصلي على رطبات، فإن لم تكن رطبات فتميرات فإن لم تكن تميرات حسا حسوات من ماء. ((رواه أبو داود والترمذي وقال: حديث حسن)).