update custom post types texsonomies with sql
im trying to update post category but i keep error messages.
I have built an update form. each category is a different product type (and a custom post).
all the other fields are working except the category
i use this wonderful guide .
i set the first query to join the table
SELECT * FROM wp_term_relationships AS tr LEFT JOIN wp_posts AS p ON tr.object_id = p.ID LEFT JOIN wp_term_taxonomy AS tt ON tt.term_taxonomy_id = tr.term_taxonomy_id LEFT JOIN wp_terms AS t ON t.term_id = tt.term_id WHERE p.post_type = 'ye_product' AND tt.taxonomy = 'category';
and sure enough i get the table.
step two was to update the table
and my code is
UPDATE wp_term_taxonomy SET term_taxonomy_id = $cat_id WHERE object_id= $post_id;
all i get is the error
1054 – Unknown column ‘object_id’ in ‘where clause’
but i can see it. the object id is right there.
so way im i getting this error
What I did or what I didn’t know I shouldn’t do and did it any way?