Get WooCommerce product attribute taxonomies in a SQL query on WordPress database

With WordPress to make a custom SQL query, you should always use the dedicated WPDB Class and related methods as get_results(), this way: global $wpdb; $results = $wpdb->get_results( ” SELECT attribute_name FROM {$wpdb->prefix}woocommerce_attribute_taxonomies ” ); if ( count($results) > 0) { $data = []; // Initializing // Loop through results objects foreach( $results as $result … Read more

How to get total count for each star rating?

You can use the function get_rating_count() by specifying on each call the value needed. For example : global $product; $rating_1 = $product->get_rating_count(1); $rating_2 = $product->get_rating_count(2); $rating_3 = $product->get_rating_count(3); $rating_4 = $product->get_rating_count(4); $rating_5 = $product->get_rating_count(5); You can read more about the function

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)