hello,

i'm a french user of wordpress and i want to UPDATE draft post to publish but there is few condition.

Table : "wp_posts"
rows : "post_author", "post_date", "post_status" and "post_category"

- i want to edit 15 post/day/different autor -> UPDATE "post_status = draft" to "post_status = publish"
- I want, at maximun, in the 15 post : one post by author different per category. I want to avoid there is more of one post per day of the same autor in a category.
- I want to start the update with the oldest post.

i have try with this but i have not the limit of 15 and the ORDER BY post_date ASC.

CREATE TEMPORARY TABLE tmp_posts_ignore
SELECT post_author, post_categorie
FROM wp_posts
WHERE post_status='draft'
GROUP BY post_author, post_categorie
HAVING Count(*)>=2;

UPDATE wp_posts SET post_status='publish'
WHERE wp_post_status='draft'
AND (post_author, post_categorie) NOT IN (
SELECT post_author, post_categorie
FROM tmp_posts_ignore
);


thank you.