mysql query
-
This should be simple, but I don’t get sql queries
Yesterday I updated a site with a thousand posts. After the update, the posts all disappeared — from the blog, and even worse, from the admin edit post page.
I could still see all the posts in phpAdmin, just not anywhere in wordpress.
Finally figured out that during the update all of the posts lost their Publish status. When I switch a Post status to ‘publish’ then it shows up fine and everything is working.
Now i just need a sql quewry that will do this for all 1000+ posts at once, rather than me having to do one at a time.
Here’s the SQL that does it for one:
UPDATE
yale20
.wp_posts
SETpost_status
= ‘publish’ WHEREwp_posts
.ID
=4 LIMIT 1 ;How do I say:
WHERE
wp_posts
.ID
=and get all of them?
thanks
- The topic ‘mysql query’ is closed to new replies.