Re: iphone 5
Following what qbankelt said...when this situations happen, the first thing you try is changing the cable, charger even try another wall socket (or USB port if charging from computer) to see if that is the problem.
If it still doesn't charge, trying turning the phone off or DFU mode (like poster above pointed).
If still nothing, try going to your closer Apple store.
Good luck.