Support » Plugins and Hacks » get user emails with $wpdb

  • Okay, here is my code:

    $usersarray = $wpdb->get_results( "SELECT user_email FROM $wpdb->users", ARRAY_N );
    foreach ($usersarray as $each_user) {
    <some other PHP code here>

    It’s simple, but $each_user still returns array, not a string as expected. Did I do anything wrong?

    Please advice.

  • The topic ‘get user emails with $wpdb’ is closed to new replies.