Praise be to Allaah.1 - Reading Quran and reflecting over the Quran Is our Duty
It is makrooh for the worshipper to start praying when he is suppressing the need to defecate or urinate, because the Prophet (blessings and peace of Allah be upon him) forbade doing that, because of what it results in of failing to attain complete focus and contemplation in prayer.
See the answer to question no. 8603
If the worshipper is suppressing the need to urinate or defecate and he cannot find any water with which to do wudoo’, it is better for him to relieve himself then do tayammum and pray.
His praying with tayammum whilst having proper presence of mind and focus is better than praying after doing wudoo’ with water but without proper focus, because the heart and essence of the prayer is proper focus (khushoo‘), so it is essential to maintain it.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) was asked: Which is better: praying with wudoo’ whilst suppressing the need to relieve oneself or to relieve oneself then do tayammum due to lack of water?
Praying with tayammum without suppressing the need to relieve oneself is better than praying with wudoo’ whilst suppressing the need to relieve oneself, because praying when suppressing the need to relieve oneself is makrooh and is not allowed, and there are two opinions concerning its validity. But praying with tayammum is valid and there is nothing makrooh in it, according to scholarly consensus.
End quote from Majmoo‘ al-Fataawa, 21/473
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: If someone were to ask: A man has wudoo’ but is suppressing the need to urinate or pass wind, but if he does so he does not have any water with which to do wudoo’. Should we tell him to relieve himself and do tayammum for prayer, or should we tell him to pray whilst suppressing the need to urinate or pass wind?
The answer was:
You should tell him to relieve himself and do tayammum; he should not pray whilst suppressing the need to urinate or pass wind. That is because praying with tayammum is not makrooh, according to scholarly consensus, but praying whilst suppressing the need to urinate or pass wind is not allowed and is makrooh. And some of the scholars regarded it as haraam and said: Prayer whilst suppressing the need to urinate or pass wind is not valid, because the Messenger (blessings and peace of Allah be upon him) said: “There is no prayer in the presence of food or when suppressing the need to urinate or defecate.” End quote from ash-Sharh al-Mumti‘, 3/236
So the prayer that you offered is valid, in sha Allah, and you do not have to repeat it.
And Allah knows best.
Read quran and it will guided us to the true teaching of The Prophet Muhammad (Peace be upon him) he summarized the religion of Islam with this statement: “The Religion is naseehah (sincerity)!” So then Tameem ibn Aws, may Allah be pleased with him, then said, “We asked, ‘To whom?’” He said: “To Allah, HIS BOOK holy quran, His Messenger, the leaders of the people, and their common folk.” [Muslim] so to study the religion people should go to the source of and source of Islam is the quran so learning quran and reading quran with the meaning the quran tafsir and then explore the words of wisdom. And for the Muslims the sincerity that is due to the Book of Allah includes doing the quran recitation, listening to quran along with learning the tajweed rules and reciting it beautifully, letting our kids learn quran learning holy quran tafseer and the reasons for its revelation, affirming that it is the Truth, the perfect Speech of Allah and not part of the creation, honoring it and defending it, abiding by the orders and prohibitions found in it and teaching quran to spread the word or truth and calling to it. So by learning quran education online and reflecting over the Quran online, one fulfills an obligation and is rewarded for that. Upon fulfilling this obligation, the Quran then becomes a proof for him on the Day of Judgment! And that is our second benefit we will take by embracing this Noble Book...