had piles, so I asked the Prophet (ﷺ) about the prayer. He said, "Pray while standing and…

Sahih al-Bukhari Book 18 Hadith 37

Sahih al-Bukhari #1117

Shortening the Prayers (At-Taqseer) 18:37

Narrated `Imran bin Husain:

had piles, so I asked the Prophet (ﷺ) about the prayer. He said, "Pray while standing and if you can't, pray while sitting and if you cannot do even that, then pray Lying on your side."

Chapter: Whoever cannot offer Salat while sitting, can offer Salat while lying on his side

Grade: Sahih