WordPress.org

Ready to get started?Download WordPress

Forums

Sql query to get all users (1 post)

  1. noslan
    Member
    Posted 2 years ago #

    Hi:

    I'm using this sql query to get all users:

    $excluded = '1,29,24';
    $sql = 'SELECT distinct post_author FROM '.$wpdb->posts. " WHERE post_author NOT IN ($excluded) ORDER BY rand()";
    $authors = $wpdb->get_results($sql)
    ;

    But whe executed always appear a repeated user with wrong "latest post" and don't know why, any idea?

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags