If you have Cydia or Installer on your iPhone, download Swaptunes and that can do it:
SwapTunes is a small binary that, when run, simply creates and switches to a new iTunes library on the iPhone itself. This new library can be synchronized with a different system. You can then run SwapTunes again to switch back and forth between the two libraries. The process works like this:
1. Sync your iPhone with the first system, acquiring the appropriate media
2. Disconnect your iPhone
3. Run the SwapTunes application (from your iPhone)
4. Go check the iPod application on the iPhone, and notice that it displays “No Content”
5. Connect your iPhone to the second system and sync it, acquiring the second set of media.
6. Run the SwapTunes application again when you want to switch back to the media acquired from the first system.
Info taken from:
http://www.iphoneatlas.com/2007/08/2...-itunes-media/