Quantcast
Viewing all articles
Browse latest Browse all 5530

040310b on "Manipulating Categories with phpMyAdmin"

The "delete query" I was attempting in 1, above, worked, but, apparently, the entire category was deleted, instead of just tweets older than 400 days.

What did I do wrong?

delete a,b,c,d
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE e.term_id =1772
AND DATEDIFF(NOW(), <code>post_date</code>) > 400

Separately, I tried the following phpMyAdmin query to merge my category 7 into my category 112731. Is the query correct, for that purpose?:

UPDATE wp_term_relationships
SET term_taxonomy_id = 112747
WHERE term_taxonomy_id = 112748;

Viewing all articles
Browse latest Browse all 5530

Trending Articles