The MU forums have moved to WordPress.org

query (4 posts)

  1. amirk011
    Member
    Posted 14 years ago #

    Below query gets a list of blogs in order of most recent update. But it doesn't bring "all posts" What could be the issue?

    $blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs WHERE public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND blog_id != '1' AND last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)ORDER BY last_updated DESC");

  2. andrea_r
    Moderator
    Posted 14 years ago #

    "WHERE public = '1' "

    Again, are all blogs public?

  3. amirk011
    Member
    Posted 14 years ago #

    yes that's what I want to change. I want to display all whether public or not, what should I do?

  4. andrea_r
    Moderator
    Posted 14 years ago #

    Then take that bit out. Because right now it only pulls public blogs. taking that part out will pull all.

    $blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs WHERE archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND blog_id != '1' AND last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)ORDER BY last_updated DESC");

About this Topic

  • Started 14 years ago by amirk011
  • Latest reply from andrea_r