Combining SELECT with UPDATE

I have the following SELECT query for a WordPress database:

Code:

SELECT * FROM wp_posts
INNER JOIN wp_term_relationships
ON (wp_posts.ID = wp_term_relationships.object_id)
INNER JOIN wp_term_taxonomy
ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
AND wp_term_taxonomy.taxonomy = 'category'
AND wp_term_taxonomy.term_id = 442);


However I need to add an UPDATE statement in there too and have no idea how to go about it.

Basically I have a field called ‘post_type’. Any record that is returned in the results of the SELECT query needs to have its ‘post_type’ field value changed to ‘featured-property’.

Does anyone know how I would go about this?

View full post on Tycoon Talk

, ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes


RSS Site FeedRSS Site Feed

© 1992-2011 DC2NET™, Inc. All Rights Reserved