Why does itunes keep deleting all the music on my iphone every time i plug it up?

Everytime i plug up my iphone all my songs gets deleted from my library.

Because you can only sync with one computer. Obviously you set it up on another computer, and you have this computer set to sync when you plug in the iPhone, so all your stuff is deleted, since your library is on another computer. You need to change the iTunes settings to not sync automatically, and import the library to the computer you want to use. That's the way Apple makes it work.