a little more details?
i had this problem yesterday. worked fine up until then... but wouldnt even register as CHARGING by the macbook....
plugged a USB flash drive in and it didnt recognise that......... for about 5 minutes.
then plugged the iphone back in and its all good.
if the phone itself is booted up fine (as in standard lock screen or springboard)
then check if its registering as charging. if not, its the USB bus on your mac. a simple restart should fix it, or i guess you could *try* what i did....
if it IS registering as charging..... well.... i think you have a bigger problem.