WordPress.org

Ready to get started?Download WordPress

Forums

get user emails with $wpdb (1 post)

  1. Hung Pham
    Member
    Posted 1 year ago #

    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.
    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags