What does a waggy tail mean?

An acquaintance rang the other day because her dog, Milo, had unexpectedly bitten someone.  She told me that he was wagging his tail, which she believed meant he was happy, so why had he bitten?  Once she told me more about what had happened, it became clear that she had misread her dog’s body language.

More info