How to: Select posts in wordpress in category and update them

Discussion in 'MySQL' started by Demon fox, Jun 24, 2010.

  1. #1
    I need help in writing up a sql query that updates posts in wp_posts table based on the category id I select.

    This query selects the posts I want but I want to update a specific column in all of these posts.

    select * FROM wp_posts
    LEFT JOIN wp_term_relationships ON(wp_posts.ID = wp_term_relationships.object_id)
    LEFT JOIN wp_term_taxonomy ON(wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
    WHERE wp_term_taxonomy.term_id = 178
     
    Demon fox, Jun 24, 2010 IP
  2. Layoutzzz

    Layoutzzz Greenhorn

    Messages:
    78
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #2
    You should write a script which will update information using data from your "select" query in cycle.
     
    Layoutzzz, Jun 27, 2010 IP