Well I hope the thing drys out. The sensors down in the selector box are not comunicating right now. Be thankful you spilled water and not soda.
I have a 2001 S500. Just above the gear selector is the cup holders. Bad idea. The PO apparently spilled too much and often. That the gear selector could not tell if it was in park or drive. So the car would not start sometimes. This is a very dangerous design flaw. There have been accidents where for no reason and at freeway speeds the car suddenly goes into reverse.
I had to have the selector replaced. This cost around $600 just for the part.
Hopefully for you yours will return to proper function. If you bought the car used, the sensors in the gear selector box are probably full of crud.
If this is the first time this has happen (say you are the origonal owner )
then maybe a gentle use of a hair dryer would work. Good luck