How to get music from iphone to itunes?

I just got a mac (an old version, not sure which one) and i logged into my itunes and its all my old music. Nothings updated. I tried clicking transfer purchases and nothing happened. So how do i get my recent music on here?

Are you sure you don't have 2 apple accounts. I ended up with two and didn't know it. Do you still have the old computer you synced your iphone to? Transfer files from it to a thumb drive and move them over to the new computer. Apple was sued several times in the past from the Napster days, as a result apple doesn't allow you to upload from the iphone/ipod to itunes, you can only sync from itunes to your iphone.
Anyway that's a personal account issue so you'll have sit on the phone with apple and resolve it or e-mail them.

You can use ipod/iphone transfer software to copy your Songs, Videos, Photos from ipod to Mac computer. Here's the one I used to use