thanks for writing to HCM,
According to the description that you provided to us, there are chances of :
severe back muscle spasms
spinal disc related issues
hip joint pathology
to find out the exact cause for the pain you need to undergo some tests:
x-ray lumbopelvic region (AP & LAT view)
(OF THE SAME AS PER YOUR DOCTORS ADVICE)
The problem that you explained has to be first correctly diagnosed by using above test and by clinical examination by orthopedic specialist. And then accordingly treated.
hope this answers your query.
wish you good health