My iPhone 4 keeps coming up with the message accessory not supported and stops charging. When I connect it to my dock it happens all the time but when I connect it to the charger it rarely says it. Is something broken
Your cable isn't registering as a certified Apple cable.
Time to replace it - or perhaps just clean the contacts.
ohhh... dock, not cable. Then more chance it's dirty contacts; but the dock may be failing.