Imran bin Husayn reported,

I had hemorrhoids, so I asked the Prophet ﷺ about prayer. He said, "Pray standing. If you cannot, then sitting. If you cannot, then on your side."

Bukhari 1117

Sahih

حدثنا عبدان عن عبد الله عن إبراهيم بن طهمان قال حدثني الحسين المكتب عن ابن بريدة

عن عمران بن حصين رضي الله عنه قال

كانت بي بواسير فسألت النبي ﷺ عن الصلاة فقال صل قائما فإن لم تستطع فقاعدا فإن لم تستطع فعلى جنب

البخاري 1117صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Shortening
Chapter
If he cannot pray sitting, he prays on his side
Numbering
Darussalam 1117
Bukhari 1117