If you write your code carefully, by using the optional connection ID parameters within your select_db() function, you should have no problems.
Be sure to specify in both the select_db() and query() functions which database connection you're using. There's no need to use an abstraction class (although it is definitely a useful utility to have in your code arsenal!), nor do you need to do stuff on one database, then the other. Just be careful when writing the code and you should have no problem concurrently connecting to and querying multiple MySQL databases.
Good luck...