How can I combine one field using wpdb and group by?

Got it working with $uvusql = $wpdb->prepare( ” SELECT p.ID, p.post_title, p.post_date, wcom.order_item_name, wcomm.meta_key, wcomm.meta_value, wcomm2.meta_key AS meta_key_qty, wcomm2.meta_value AS meta_value_qty, pm2.meta_value AS meta_value_location FROM $wpdb->posts AS p INNER JOIN $wpdb->postmeta AS pm ON p.ID = pm.post_id INNER JOIN $wpdb->woocommerce_order_items AS wcom ON p.ID = wcom.order_id INNER JOIN $wpdb->woocommerce_order_itemmeta AS wcomm ON wcom.order_item_id = wcomm.order_item_id … Read more

Undefined offset: 0

Fixed it. function getUserIDandPush($ul){ global $table_prefix; // Prefix for Database table global $user_login; global $wpdb; // WordPress WPDB database method $dt = $table_prefix; //Tables Prefix if (!is_user_logged_in() && isset($_SERVER[‘LOGON_USER’])) { $as = $wpdb->get_results(‘SELECT * FROM ‘.$dt.’users WHERE user_login = “‘.$ul.'” ‘); $usID = $as[0]->ID; wp_set_current_user($usID, $ul); wp_set_auth_cookie($usID); do_action(‘wp_login’, $ul); } }

How to display user_nicename and usermeta values by custom query in WordPress?

To do that with WordPress functions, you can try that $users = get_users(); ?> <table> <tr> <th>Customer Name</th> <th>Customer Details</th> </tr> <?php foreach ($users as $u) {?> <tr> <td> <?php echo htmlspecialchars($u->display_name);?> </td> <td> <?php echo htmlspecialchars($u->description); // retrieve the meta “description”?> </td> </tr> <?php }?> </table> <?php

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