Title: Calculation Error
Last modified: June 14, 2024

---

# Calculation Error

 *  Resolved [marzoolio](https://wordpress.org/support/users/marzoolio/)
 * (@marzoolio)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/calculation-error-7/)
 * Hi,
 * I have problem with calculation and I get error message every time. I enabled
   debug and it’s giving me this error code:
   PHP **Fatal** **error:**  Football 
   Pool => default ranking with ID 1 is missing in the `pool_wp_rankings` table 
   in /share/CACHEDEV1_DATA/Web/MyBet/wp-content/plugins/football-pool/admin/class-
   football-pool-admin-score-calculation.php on line 1089
 * …so it’s pointing on this function
 *     ```wp-block-code
       private static function get_rankings(): ?array
       {
           $cache_key = 'fp_calc_rankings';
           if ( ! self::cache_key_exists( $cache_key ) ) {
               global $wpdb;
               $prefix = FOOTBALLPOOL_DB_PREFIX;
   
               $sql = "SELECT id FROM {$prefix}rankings ORDER BY id ASC";
               $rankings = $wpdb->get_col( $sql );
   
               // throw error if the default ranking is missing from the database
               if ( count( $rankings ) === 0 || ! in_array( FOOTBALLPOOL_RANKING_DEFAULT, $rankings ) ) {
                   trigger_error( 'Football Pool => default ranking with ID ' . FOOTBALLPOOL_RANKING_DEFAULT .
                       ' is missing in the ' . FOOTBALLPOOL_DB_PREFIX . 'rankings table', E_USER_ERROR );
               }
   
               $rankings = array_map( 'intval', $rankings );
   
               self::set_value_in_cache(
                   $cache_key,
                   apply_filters( 'footballpool_score_calc_rankings', $rankings )
               );
           }
   
           return self::get_value_from_cache( $cache_key );
       }
       ```
   
 * Can you point me the way where to find what is wrong, please ? 🙂
 * Great job with the plugin, I’m just messing my site, thanks! 😀
    -  This topic was modified 1 year, 11 months ago by [marzoolio](https://wordpress.org/support/users/marzoolio/).

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

 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/calculation-error-7/#post-17826582)
 * you can fix this by executing the following query:
 *     ```wp-block-code
       INSERT INTO pool_wp_rankings (id, name, user_defined, calculate) VALUES (1, 'default ranking', 0, 1);
       ```
   
 *  Thread Starter [marzoolio](https://wordpress.org/support/users/marzoolio/)
 * (@marzoolio)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/calculation-error-7/#post-17826585)
 * Omg, thanks! 😀

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

The topic ‘Calculation Error’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [marzoolio](https://wordpress.org/support/users/marzoolio/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/calculation-error-7/#post-17826585)
 * Status: resolved