Thread moved to Code Critique forum.
While I think it's commendable you added some sanity checks to make sure $db is what you say it should be, note that you could also (or alternatively?) use type hinting (man page: [man]oop5.typehinting[/man]) in the parameter list to indicate that $db should be a MySQLi object.
Also note that you might add some more checks to verify that you're actually connected to a MySQL server, know the name of the database you want to check, etc.
Finally, note that if the table doesn't actually exist you'll be generating a SQL error by trying to SELECT data from a nonexistent table. I personally would opt for a better approach such as executing a query like the following:
SELECT COUNT(*)
FROM information_schema.tables
WHERE table_schema = '[database name]'
AND table_name = '[table name]';
and check if any rows were returned.