I had an idea i come up with is it possible to link both wp desktop and wp mobile on the same db for example I have wp desktop link to example.com and wp mobile link to m.example.com
I'm not sure I understand you - why do you want to have it linked to separate databases? The desktop and mobile versions are just the display of information - it's got nothing to do with what's running in the background. If you want to separate stuff, like have distinct content for the desktop and mobile versions (why, though?), you can do that via server-side content separation, or javascript, or via other means.