Unknown column ‘business_id’ in ‘where clause’ for query
-
Since updating the plugin to version 2.4.1 with WordPress version 6.2, the following error is occurring, on initial check, it looks like a DB column name has either changed or not updated correctly.
PHP message: WordPress database error Unknown column 'business_id' in 'where clause' for query SELECT count(*) FROM wp_grp_google_review WHERE business_id = 6 made by do_action('wp_ajax_grw_feed_save_ajax'), WP_Hook->do_action, WP_Hook->apply_filters, WP_Rplg_Google_Reviews\Includes\Feed_Serializer_Ajax->save_ajax, WP_Rplg_Google_Reviews\Includes\Core\Core->get_reviews, WP_Rplg_Google_Reviews\Includes\Core\Core->get_data, WP_Rplg_Google_Reviews\Includes\Core\Core->get_google_reviews" while reading response header from upstream
Looks like the column
business_id
has been renamed togoogle_place_id
The issue looks to be within the
class-core.php
file on line 220.// Calculate Google reviews count if (isset($place->review_count) && $place->review_count > 0) { $review_count = $place->review_count; } else { $review_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM " . $wpdb->prefix . Database::REVIEW_TABLE . " WHERE business_id = %d", $place->id ) ); }
Hope this helps resolve the bug currently being seen.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Unknown column ‘business_id’ in ‘where clause’ for query’ is closed to new replies.