Hello,

I have two databases in MySql...
Master database and child database..
In master database there are two tables...Accountant(Having Primary Key AccountID) and Client(Having Primary Key ClientID)...
Now for each client master database remains same and child database is created for each client...
In child database,there are several tables related to Sales,Purchase,etc..
Now in child databases, I want to use AccountID and ClientID as foreign keys.....

How to connect these two databases?

You can prefix the table name with the (dot-terminated) database name in queries, thus allowing for joins across database limits. To the beste of my knowledge, you cannot create foreign keys, though, which are maintained by InnoDB.

Ya using joins I can do...but I don't want to use joins...
Like in a single database,we set foreign keys between tables...In that way I want to set relationship between tables of two different databases...
Can u tell me how it is maintained by InnoDB? I dont's know much about that...

You seems to be confused or your you have not explained your case exactly.
So what is relation between account and client, that will decide how to use accountid and clientid in other tables

Do you have many client for one account?
or do you have one client may be linked with many accounts?
or one account for one client?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.