I was wearing my favourite jeans a few days ago, I bent over while holding my nephew and the button on my jeans popped off.

I tried to fix it myself with a hammer but it won't stay. I then took it to an Alterations place but the guy said no he couldn't fix it.
Has anyone else had the same problem and can you make suggestions as to how I can get it fixed? They're my favourite jeans so I don't want to cut my losses and throw them out just yet.