And the practice is according to both hadiths.
242- Issue: He said: (And as for the sick person, if standing increases his illness, he shall pray sitting.)
The scholars have reached a consensus that whoever is unable to perform the standing posture has the right to pray sitting. The Prophet (peace be upon him) said to 'Imran ibn Husayn: "Pray standing; if you are unable, then sitting; if you are unable, then on your side." Extracted by al-Bukhari, Abu Dawud, and al-Nasa'i (1), and they added: "If you are unable, then lying on your back, {Allah does not burden a soul beyond that it can bear} (2)." Anas narrated that the Messenger of Allah (peace be upon him) fell from a horse and his right side was grazed or scraped (3). We went to visit him, and the time for prayer came, so he prayed sitting and we prayed behind him sitting. It is mutually agreed upon (4).
= The Chapter on Voluntary Prayer Sitting, from the Book of Establishing Prayer. Sunan Ibn Majah 1/388. And Imam Ahmad, in: al-Musnad 6/30, 98, 100, 113, 166, 204, 217, 227, 262, 265. (1) We did not find it in al-Nasa'i; see: Tuhfat al-Ashraf 8/185. It was extracted by al-Bukhari, in: The Chapter of If One Cannot [Stand] Sitting, He Prays on His Side, from the Book of Shortening, and Abu Dawud, in: The Chapter on the Prayer of the One Sitting, from the Book of Prayer. Sunan Abi Dawud 1/218. And al-Tirmidhi, in: The Chapter on What Came Regarding the Prayer of the One Sitting Being Half the Prayer of the One Standing, from the Chapters on Prayer. 'Aridat al-Ahwadhi 2/166. And Ibn Majah, in: The Chapter on What Came Regarding the Prayer of the Sick, from the Book of Establishing Prayer. Sunan Ibn Majah 1/386. And Imam Ahmad, in: al-Musnad 4/426. (2) The last verse of Surah al-Baqarah. (3) Al-Jahsh: Abrasion and peeling of the skin. (4) Extracted by al-Bukhari, in: The Chapter of Prayer on Roofs, the Pulpit, and Wood, from the Book of Prayer, and in: The Chapter of the Imam Being Appointed Only to be Followed, the Chapter of the Obligation of Takbir and Commencing Prayer, and the Chapter of Inclining with Takbir when Prostrating, from the Book of Adhan, and in: The Chapter of the Prayer of the One Sitting, from the Book of Shortening. Sahih al-Bukhari 1/106, 177, 187, 203, 2/59. And Muslim, in: The Chapter of the Follower Following the Imam, from the Book of Prayer. Sahih Muslim 1/308. It was also extracted by Abu Dawud, in: The Chapter of the Imam Praying While Sitting, from the Book of Prayer. Sunan Abi Dawud 1/141. And al-Tirmidhi, in: The Chapter on What Came Regarding if the Imam Prays Sitting, then You Shall Pray Sitting, from the Chapters on Prayer. 'Aridat al-Ahwadhi 2/156. And al-Nasa'i, in: The Chapter of Following the Imam Who Prays Sitting, from the Book of Imamat. al-Mujtaba 2/77. And Ibn Majah, in: The Chapter on the Imam Being Appointed Only to be Followed, from the Book of Establishing Prayer. Sunan Ibn Majah 1/392. =