Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.2k views
in Plugins by

When I have installed the plugin theme-switcher I get

Database query error 1146

Table 'bibfaq_main.qa_usermeta' doesn't exist

SELECT meta_value FROM qa_usermeta WHERE user_id=1 AND meta_key=_utf8 'custom_theme'

Apparently the plugin expects such a table but where to find it?

 

 

Q2A version: 1.4.3

1 Answer

0 votes
by

Like any database table, it should be found in the database :)

I'm not sure how this happens, but it's a bit of a problem; I think you can fix it in this way:

  1. update the plugin to the latest git version
  2. go directly to yoursite.com/admin/plugins (type it into the address bar, don't visit your site)

This should now create the table if it doesn't exist.

 

by
Nope! One step forward, however. No error_log this time, but still no table inserted in the database...
by
edited by
strange... try downloading the admin plugin, and putting this in the admin plugin box:

            qa_db_query_sub(
                'CREATE TABLE IF NOT EXISTS ^usermeta (
                meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                user_id bigint(20) unsigned NOT NULL,
                meta_key varchar(255) DEFAULT NULL,
                meta_value longtext,
                PRIMARY KEY (meta_id),
                UNIQUE (user_id,meta_key)
                ) ENGINE=MyISAM  DEFAULT CHARSET=utf8'
            );

Edit: if you can't access admin/plugins, try putting the above code in the theme-switcher's qa-plugin.php, right after the opening <?php tag.
by
Adding the table manually did the trick! Thank you very much!
by
NoahY, on your Git-Hub page, the instructions says:

git clone git://github.com/NoahY/q2a-admin.git admin

should be

git clone git://github.com/NoahY/q2a-admin-plus.git admin-plus

but that was pretty obvious.
...