Title: Database problems
Last modified: March 27, 2023

---

# Database problems

 *  Resolved [reinispro](https://wordpress.org/support/users/reinispro/)
 * (@reinispro)
 * [3 years ago](https://wordpress.org/support/topic/database-problems-37/)
 * Hello again Antoine,
 * I wanted to make matches for the upcoming games and when I went to teams menu
   it was empty. Did not think much of it as there are not a lot of teams, so I 
   wanted to create them from a scrach. When I tried, I could not as after saving
   nothing showed in the table.
 * I turned on de-bugging and got this error:
 * **WordPress database error:** [Unknown column ‘t.is_favorite’ in ‘field list’]
   `
   SELECT t.id, t.name, t.photo, t.flag, t.link, g.id AS group_id, g.name as group_name,
   t.is_real, t.is_active, t.is_favorite, t.group_order, t.comments FROM pool_wp_teams
   t LEFT OUTER JOIN pool_wp_groups g ON t.group_id = g.id ORDER BY t.name ASC`
 * I suspect there might be some problem that after upgrading to newest version 
   plugin did not create the necessary field. As my current table in DB looks like
   this:
 * [https://ibb.co/z8M58QN](https://ibb.co/z8M58QN)
 * Is it possible to just add the necessary field without braking the DB or it has
   to be made from scratch?
   EDIT#1 DB table indeed have all the team data, it just
   cannot display in site because of this error.
    -  This topic was modified 3 years ago by [reinispro](https://wordpress.org/support/users/reinispro/).
    -  This topic was modified 3 years ago by [reinispro](https://wordpress.org/support/users/reinispro/).
    -  This topic was modified 3 years ago by [reinispro](https://wordpress.org/support/users/reinispro/).

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

 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [3 years ago](https://wordpress.org/support/topic/database-problems-37/#post-16600326)
 * You can run the DB update script for v2.11.0 again to fix this problem:
 *     ```wp-block-code
       CREATE TABLE IF NOT EXISTS pool_wp_predictions_audit_log (
         log_date DATETIME NOT NULL ,
         user_id INT UNSIGNED NOT NULL ,
         type TINYINT UNSIGNED NOT NULL ,
         source_id INT UNSIGNED NOT NULL ,
         result_code TINYINT UNSIGNED NOT NULL ,
         log_value VARCHAR(200) NOT NULL ,
         INDEX ix_log_date (log_date),
         INDEX ix_user_id (user_id),
         INDEX ix_source_id (source_id)
       ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
   
       ALTER TABLE pool_wp_teams ADD is_favorite TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER is_active;
       ```
   
 *  Thread Starter [reinispro](https://wordpress.org/support/users/reinispro/)
 * (@reinispro)
 * [3 years ago](https://wordpress.org/support/topic/database-problems-37/#post-16602963)
 * Thank you, it worked!
 *  [robb1e](https://wordpress.org/support/users/robb1e/)
 * (@robb1e)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/database-problems-37/#post-16702559)
 * How/where do you run the database script?
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/database-problems-37/#post-16704520)
 * [@robb1e](https://wordpress.org/support/users/robb1e/) you can run the script
   in a database tool. A lot of hosters provide you with a phpMyAdmin interface,
   but it can also be something else.
 *  [robb1e](https://wordpress.org/support/users/robb1e/)
 * (@robb1e)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/database-problems-37/#post-16704532)
 * I just got paste in the SQL bit and ‘run’ it?
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/database-problems-37/#post-16704543)
 * Yes, but first please check if your table names for the plugin start with the“
   pool_wp_” prefix. If not, then you’ll need to change the script by replacing 
   the prefix with your own.
 * And please create a database backup if you’re doing changes to your database!
   Better safe than sorry. If you don’t know how, then ask your hoster for help.
 *  [robb1e](https://wordpress.org/support/users/robb1e/)
 * (@robb1e)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/database-problems-37/#post-16704709)
 * thanks for the info. I’ll give it a go. The fact I currently run a live sports
   website with live results, leagues and fixtures mid season is making me sweat
   lol.
 *  [robb1e](https://wordpress.org/support/users/robb1e/)
 * (@robb1e)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/database-problems-37/#post-16705108)
 * Antoine I did what was required but i now get this warning:
 * **WordPress database error:** [Unknown column ‘question_order’ in ‘order clause’]
   `
   SELECT id, match_id FROM pool_wp_bonusquestions WHERE match_id > 0 ORDER BY match_id
   ASC, question_order ASC, answer_before_date ASC`
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/database-problems-37/#post-16705337)
 * Seems like your upgrade path was a bit ‘longer’ and you’re not only missing the
   version 2.11 database upgrades. Because the `question_order` column was introduced
   in version 2.9.0.
 * I suggest you also run the following scripts:
 * [v2.9.0](https://www.dropbox.com/s/wdx2pr8wiu2bkad/sql-2.9.0.txt?dl=0)
   [v2.9.3](https://www.dropbox.com/s/2t6uz4vftp6gtqd/sql-2.9.3.txt?dl=0)
   [v2.10.0](https://www.dropbox.com/s/i122c8z83nmk0nq/sql-2.10.0.txt?dl=0) ^(*))
 * And perhaps even the v2.8.0 one^(**)):
 * [v2.8.0](https://www.dropbox.com/s/ww9t2cw1vbntzal/sql-2.8.0.txt?dl=0)
 * _^(*)) After running all database scripts, you’ll have to start a calculation
   to create a ranking._
 * _^(**)) Please note that some of the statements may result in a warning because
   it tries to remove an index that does not exist or to add one that already exists.
   You can ignore those warnings. They are in those cases an indication that this
   particular update was already succesfull_
 *  [robb1e](https://wordpress.org/support/users/robb1e/)
 * (@robb1e)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/database-problems-37/#post-16705344)
 * i haven’t even had the chance to use it yet as my install was directly from my
   wordpress add new plugin section. Downloaded 1 or 2 days ago to try.
 * does every new user have to go through this to get it to work?
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/database-problems-37/#post-16705375)
 * No, this is highly unusual. But probably you’ve tried the plugin before in the
   past (some years ago) that left the tables behind in the database. Because the
   plugin will not install with only one column missing. That is impossible.
 * It is a lot easier (and safer) to just deactivate the plugin (make sure you first
   uncheck the option on the plugin options page that says to “keep data on uninstall”).
   That will remove all custom tables for my plugin from your database. And then
   activate the plugin again to start with a 100% clean install.

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

The topic ‘Database problems’ is closed to new replies.

 * ![](https://ps.w.org/football-pool/assets/icon-256x256.png?rev=983880)
 * [Football Pool](https://wordpress.org/plugins/football-pool/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/football-pool/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/football-pool/)
 * [Active Topics](https://wordpress.org/support/plugin/football-pool/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/football-pool/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/football-pool/reviews/)

## Tags

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

 * 11 replies
 * 3 participants
 * Last reply from: [AntoineH](https://wordpress.org/support/users/antoineh/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/database-problems-37/#post-16705375)
 * Status: resolved