If you got time, download phpld directory script from phplinkdirectory.com and install it on one subdomain, and install wordpress on other, and try to import the sidebar on your phpld script, than maybe you might be able to understand the whole situation better and will wait for you to reply "Y " followed be "E" and than "S".
I would love to do that, however I'm not going to spend $25.00 for the script -- so thats not going to happen.
I will show you this though ..
http://pay.onewish.org.uk/ thats a default install of php coin, its a payment system written in PHP. Its MySQL driven.
You will notice at the bottom of that page that there is something that looks like WordPress sidebar. It looks like one because thats exactly what it is. And its dynamically included on a subdomain that is different than the subdomain that the WordPress blog is on using 2 very simple lines of code:
the blog, on another subdomain is over here:
As I previously stated, it can be done, its done all the time. Theres no magic.
Now Ive also tested another theory where perhaps the mysql session isnt being closed properly so the database calls that your
get_sidebar(); are making are to the other database.
While I can move my sidebar around in this page and nothing breaks database-wise - that too might be your problem.
You can doublecheck, experiment with that being the problem... that by forcing the mysql session for the phpld script to close before trying to call the sidebar bit. IF in fact, its not closing.