You should only have ONE database.
You put all your tables in the same database.
You only need one connect.php script for your entire site, which you "include" where required.
You select individual tables using SQL queries.
Eg: "SELECT * FROM myTable;"
It is possible to use multiple databases as you have, and still use one connect.php script.
You could use an if .. else construct to select the correct database based on the current page name, for example.
This is an unnecessary complication, but would work.