set up 1 database per domain

Just an idea that I am entertaining, suppose that I have domainA.com and doaminB.com

Both are the exact same web application (code level) with different databases. DomainA.com will use databaseA and DomainB will use databaseB. However, DomainA and DomainB use the same codes.

How do I setup something like that? What happens if I have 1000 of them? Does the web application slow down? Is the setup feasible?

Thank you

Maybe this helps

http://www.yiiframework.com/forum/index.php/topic/61176-change-db-connection-dynamically/

Thanks, it did

thanks for the tip. i will try it out