Hi All,
I have a quick question about modifying SQL. I just changed CMS (blog) packages, and ran someone else's import script to move my data from one type of software to another. The conversion went great, but the post author didn't get updated. I started modifying them manually, but I have hundreds of posts, this is going to take forever.
The table has a field for post_author. Most of the posts have 0's for this field (no author specified), I need them to all be one's (me). Is there a script that I can run to do this? I have SSH and phpMyAdmin.
I've backed this database up six ways from Sunday, so if I blow it all up I can recover (though I don't know exactly how to do that, either).
Use the SQL tab in phpMyAdmin to run the following query (replacing "table_name" with the actual name of the table in question):
Code:
UPDATE table_name SET post_author = 1 WHERE post_author = 0;
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Thanks NogDog, that worked perfectly. It updated 158 posts in .308 seconds. Beautiful.
You're welcom.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
I suppose you trying some data recovery tool, yet there is no guarantee indeed that can help. However, it is suppose to use a powerful one. As for me, I've been using Undelete for a while, that is a really powerful utility. IF you wish, you can also try it out. http://www.active-undelete.com/
Bookmarks