Have you tried a different charger? A different cable? (Just to make sure that your charger or cable didn't go bad.)
If the charger and cable are both good, there are two possibilities, either the charging port in the phone is bad or the battery is bad. (If you regularly let the battery get down to 3%, I'd suspect that it's the battery. Never let the battery - any lithium battery - get down below 40%.)
If it's a bad battery, and it's removable, you can get a new one and replace it. Otherwise it has to go into a repair shop, either for a new battery or for a new charging port. Get a price first - if it's a cheaper phone, it may be cheaper to get a new one than to fix the old one.