Wednesday, December 23, 2009

How to join mutliple database using coding?

Izit possible to join 2 or more database using asp or php coding.. gimme some light here..How to join mutliple database using coding?
certain databases like mysql achieves this by using the dot operator ';.';


say db1 has table1(field1) and


db2 has table2(field2)then





select a.*,b.* from db1.table1 a,db2.table2 b where


a.field1 = b.field2How to join mutliple database using coding?
depends on what you want to do.





if there is data in two separate DBs that you want to fetch separately and then in your code do some processing to merge/join them, then just create separate connections to each database and use them individually to fetch the data and process it in your asp/php code.





if you need to do the join within the DBs themselves (due to the nature of the data, or size of the possible result or something like that) then you need to make sure that you can establish a connection from one DB to the other DB itself, (which isn't always the case, sometimes you need your application to act as a bridge between the two because of permissions, firewalls, etc)

No comments:

Post a Comment