I am developing a system to use with several websites. I have a database for each client that I am having utilize my system. In each database is a table called members.
Some backstory as to what I'm doing...
All the accounts using my system have information added to a table in the database main called clients. There I store the index of the client, the name of the client, the database of the client, etc...
What I need to be able to do....
So, I want to be able to query all the member tables of all the databases. From there I can do statistical analysis of my members data, select a random member, or whatever, but I need all the member table records from all the databases in the same array (from a mysql query).
What would be the best approach to this? A sort of SELECT * FROM members for all member tables in all databases. Note, I can form a list of databases if need be.
Or, I could just make all the member data in the main database of my system and attach a client ID to each member. The only drawback to this is modifying thousands of lines of code and modifying my five current websites that use this system to follow the new table rules, update their indexes, update everything that uses the member's index as a foriegn key, etc...
So, the first approach would be much more preferable.