Back pain

Hello i have a back pain from past 3 months which started after having deep nap and my right hip start to lock and my movements were restricted. I couldn’t walk and run properly i had so much pain but it got better for week or 2 and then it start to hurt in left hip after that it’s vary , sometime in right hip and sometime in the left hip. My matress was very bad from the middle but now im sleeping on the carpet floor.When i work then i get some releif but before going to bed my pain gets worst.

You should get a CT Scan of back done to find the exact reason for the issue. The bad sleeping posture might have been just a trigger to the underlying dormant problem. Consult an orthopaedic doctor with all the reports.