In my code down below. When I click the second tab the code checks the database, if the database has tables, it takes the names of the tables and create tabs within a predefined