Title: Theme settings in database
Last modified: November 11, 2017

---

# Theme settings in database

 *  Resolved [Michael v.d. Berg](https://wordpress.org/support/users/michaelvdberg/)
 * (@michaelvdberg)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/theme-settings-in-database/)
 * I have a question. WordPress saved all posts, pages and images in a database.
   I would like to install a multi-functional theme (like Jupiter/BeTheme/Bridge)
   as the theme of the WordPress website, but it saved some settings in the same
   database.
 * Is it possible to save the theme settings of the multi-functional theme in a 
   different database? And if it’s possible, how can I setup this connection?
 * For example:
    – Posts/pages/images in Database 1 – Multi-functional theme in 
   Database 2

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [brendovale](https://wordpress.org/support/users/brendovale/)
 * (@brendovale)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/theme-settings-in-database/#post-9671724)
 * Hi!
 * You can make a class ‘MyDBCon’
 * class MyDbCon{
    //SetUp you php connection }
 * in you plugin or function …
 * call class.
 * or
 * Make a new table in you wp database!
    See this code do add a table
 *     ```
       class InstalaDesinstala {
   
   
           function create_tables() {
               global $wpdb;
               require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
   
               $sql_partners = " 
                                   CREATE TABLE <code>&quot; . $wpdb->prefix . &quot;cliente</code> (
                                    <code>id</code> int(10) UNSIGNED NOT NULL,
                                    <code>cliente</code> varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
                                    <code>categoria</code> varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                    <code>estado</code> varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                    <code>endereco</code> varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                    <code>telefone</code> varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                    <code>email</code> varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
                                    <code>logo</code> text COLLATE utf8mb4_unicode_ci,
                                    <code>created_at</code> timestamp NULL DEFAULT NULL,
                                    <code>updated_at</code> timestamp NULL DEFAULT NULL,
                                    <code>deleted_at</code> timestamp NULL DEFAULT NULL
                                  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
                               ";
   
               dbDelta($sql_partners);
           }
   
   
   
       }
       ```
   
 * you can call this -> register_activation_hook <- on you theme install.
 * see
 *     ```
       function INSTALL() {
          you call
       }
   
       function UNINSTALL() {
           you call
       }
   
   
   
       register_activation_hook(__FILE__, 'INSTALL');
       register_deactivation_hook(__FILE__, 'UNINSTALL');
       ```
   
 * see you man .
 * sorry for my english.
 *  Thread Starter [Michael v.d. Berg](https://wordpress.org/support/users/michaelvdberg/)
 * (@michaelvdberg)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/theme-settings-in-database/#post-9673097)
 * Great, thank you for your quick reply and code. I will try it and configure it
   to my server. Thanks for your help! Have a good one 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Theme settings in database’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Michael v.d. Berg](https://wordpress.org/support/users/michaelvdberg/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/theme-settings-in-database/#post-9673097)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
