Will updating iphone software make it charge again?

I haven't updated itunes on my computer for ages and on my iphone there's been a notification to update software for ages. My iphone 3 won't charge, well it will but only if its powered off and plugged into computer.doesn't charge through wall chargers or if powered on it won't charge on computer. I can't afford a new phone and i need my phone to be fixed as it has photos of my newborn.itunes or my computer doesn't recognise it. Will restoring it make it charge again. But then sgain ill lose my fotos

Added (1). @ james: yeah i thought battery or hardware.can't transfer photos though because its not recognised.

Does anyone know how much it costs to get a new battery put in or hardware to get fixed?

More than likely this will not fix the issue. The issue you seem to have is most likely caused by a bad battery.

In regards to your photos, you can transfer the photos to your PC before restoring and then add them back on your iPhone once you're on the new version of iOS, and you won't lose them.