I got my iPhone in may, and have never synced it to a computer. I would like to now so that I can out music from my CDs on it. But when my friend synced her iPhone 4 to a computer it erased all of her pictures. What can I do so that doesnt happen?
Either iPhoto or Image Capture will let you pull all your photos off the phone to get the safely onto the computer. From there you can store them wherever you want.
DropBox also has a camera upload function now so you can upload straight to DropBox from the phone, or from the computer when you plug your phone in.
Just make sure you use iPhoto or Image Capture first when you plug in your phone.
If you plug the phone into your computer and set it up with iTunes it might prompt you to reset it to automatically sync with that computer. You can do that after you've removed the photos using iPhoto.
If you do sync with iPhoto it'll give you the option to remove the photos from your phone after syncing - that's your choice.
Finally, if you're worried about losing photos, you can configure iPhoto on your computer to use Photo Stream, and on your iPhone too in the iCloud settings. That'll copy the photos to the cloud, and then iPhoto automatically, so you don't need to plug in your phone to sync each time.
Most of this assumes you have a Mac computer, btw, you don't make clear whether you're syncing to a Mac or PC.
You should make sure that you sync it with iPhoto or whatever photo program you have first, and then sync the phone via itunes.
iTunes might automatically popup and start asking you stuff, but just ignore it and import the photos using some program.