Hi Ivy, this happened to me one time, and resetting it by holding the home and power button for about 30 seconds has worked for me. The cause on mine was water damage, so it's possible that if it is still wet this won't work, so try leaving it vertically in the sun or by heating it from afar with a hair dryer for 30 seconds.
Hi, this has happened to me several times before, and most of the time you have to ccheck if you have an original apple charger and base of the charger. If it still isn't working check if it charges on another person's charger or if another phone charges into yours.