(19) باب إِذَا لَمْ يُطِقْ قَاعِدًا صَلَّى عَلَى جَنْبٍ
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."
Reference: Sahih al-Bukhari 1117
In-book reference: Book 18, Hadith 37
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 2, Book 20, Hadith 218