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