Do you have any medication for the panic attacks? Like anti-anxiety medication? Do you know what brings on your panic attacks? Is it a specific trigger or is it generalized anxiety?
I would get a second-opinion, just in case. The pain could be from the panic attacks, but if they are different problems, the doctor may not catch it if he thinks they are related. Make sure they do tests to rule things out rather than just dismiss your pain. Also, don't leave without a plan to make your attacks and your pain better, whether it be medication, counseling, acupuncture, relaxation techniques, or whatever. Draw up a plan with the doctor and go back if it doesn't work.
Good luck.