I had a fistula, so I asked the Prophet ﷺ about prayer. He said, "Pray standing. If you cannot, then sitting. If you cannot, then on your side."
حدثنا علي بن محمد حدثنا وكيع عن إبراهيم بن طهمان عن حسين المعلم عن ابن بريدة
كان بي الناصور فسألت النبي ﷺ عن الصلاة فقال صل قائما فإن لم تستطع فقاعدا فإن لم تستطع فعلى جنب
[Sahih]. Abu Dawud narrated it in the Book of Prayer, chapter on praying while sitting, hadith 952, from the hadith of Waki with this chain. Bukhari narrated it, hadith 1117, from the hadith of Ibrahim with this chain, and it has other routes of transmission with him and with others.