وردپرس

Calculation Error | WordPress.org


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

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 );
}

I think my database is some way corrupted so can you give me a hint how can I fix the issue? Of course I don’t want to loose users predictions but I think I just need to reset the ranking table maybe?

I have access and basic understanding how SQL tables work so can you teach how to reset only this table? or is it something else?

Great job with the plugin, I’m just messing my site, thanks! ?

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا