I have implemented the WMD control that Stack Overflow uses into a project of mine, it almost works like a charm, but when I save the changes to the databas
Before you include wmd.js, or whatever you've named the WMD editor JavaScript code locally, add one line of JavaScript code:
wmd.js
wmd_options = {"output": "Markdown"};
This will force the output of the editor to Markdown.