How to transfer all my music from iphone to my computer?

So um, yeah, i lost all my music files yesterday because i reformatted my computer and updated it to windows 7 and i downloaded itunes again. I downloaded 2 songs (so basically i only have 2 songs in my new library) and it won't sync to my iphone, any way to make it sync to my iphone?

I had a similar problem, i have an andriod and for some reason it wouldn't connect to my laptop so i downloaded xCloud to my laptop and phone and it is great for transferring any type of file between my pc and cell. You can download xCloud from the app store so you should try it. Hope it works!