I am not an AME but this is not correct. I have a number of pilots on all sorts of medications for spinal pathology who are flying. One today in fact.
NSAIDs and simple analgesics do not stop you flying. Gabapentin does - there is a thread about this. An operative procedure will ground you temporarily.