WordPress.org

Ready to get started?Download WordPress

Forums

Need SQL Help!! (2 posts)

  1. jwilliams
    Member
    Posted 8 years ago #

    My SQL database has 0's listed in the wp_posts/post_catagory fields.

    I am trying to modify this:

    <?php get_results("SELECT ID,post_title FROM $wpdb->posts
    WHERE post_status= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many);
    ?>

    $how_many is a variable i defined earlier in the php script.

    I want to get info on posts from a specific category. so I need to basically change:

    WHERE 'post_status'=\"publish\"

    to

    WHERE 'post_status=\"publish"\ AND (something else)

    But I dont know what the something else is, and need your help!!

    Thanks,
    Jameson

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

    How did this happen? What happened before it?

Topic Closed

This topic has been closed to new replies.

About this Topic