www.webdeveloper.com
Results 1 to 5 of 5

Thread: Data Changing

  1. #1
    Join Date
    Mar 2006
    Location
    Austin, TX
    Posts
    6

    Data Changing

    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).

    Thanks in Advance,
    Chris

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,926
    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

    eBookworm.us

  3. #3
    Join Date
    Mar 2006
    Location
    Austin, TX
    Posts
    6
    Thanks NogDog, that worked perfectly. It updated 158 posts in .308 seconds. Beautiful.

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,926
    Quote Originally Posted by lenwood
    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

    eBookworm.us

  5. #5
    Join Date
    Apr 2006
    Posts
    2
    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/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles