My iPhone 3GS won't charge but will charge my iPhone 3 with the same charger?

Last night I put my iPhone 3GS on charge to find that it wasn't charging. I fiddled about then it started charging again. It has been charging fine all day today, until I took it off to answer the phone and then once I put it back it wouldn't charge at all. It had 3% battery. I then put my iPhone 3 on charge with the same charger to find it was working fine. Charged fine and everything so I automatically thought it was the phone. I then got my mum's iPhone 4 charger and plugged my iPhone 3GS in and it charged. I have got my charger and plugged it into my computer, and any other power sources and it will not work. Why is it charging my iPhone 3 and not my iPhone 3GS? And why will my mum's charger charge it if my own charger won't?

Either the battery is shot or the contacts are shot. You can try cleaning the battery contacts to see if this helps.