How to fix my iphone when it won't charge?

I've tried multiple chargers and through both the wall outlet and my computer, but it keeps not charging at all. Sometimes it says that "charging is not compatible with this accessory", but most often it won't even recognize that its connected to the charger. Its an older model, but still works great when its charged. Will restoring it help at all?

Take to the apple store to see what's wrong duh