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
Combining, Select, update