Schema Name - Number of Books
"Library A" - 10
"Library B" - 15
I am not the owner of the databases so I cannot change the fact that multiple databases were used vs using one relational database to store this information. So I've got one database per "Library" and each database has a "Books" table with "id" being one of the elements in the table - so I can use "count(id)" to get the number of books. Is there a way, using PHP, to loop through all of the databases and display the information like this? My biggest problem, I think, is that I cannot query for the database name while using the database. I have to get the database names from the Information_schema.schemata table. So I'm trying to figure out how to loop through the results of a "select schema_name from information_schema.schemata" query and for each element in the array get the count of id's in the books table. I'm new to php and mysql and am not up to speed yet on arrays. Any suggestions/help is much appreciated!
This post has been edited by kmkphp: 25 June 2009 - 10:13 AM