Jump to content

Updating / merging single column of data


imekul

Recommended Posts

Hi guys,

 

I have a WordPress database that has 751 blog entries that I have imported.  The problem is that the dates are incorrect, and I want to fix them.  Instead of manually updating each row (which, obviously, would take quite some time), I'd like to be able to import data straight into the post_date column of my table.

 

The "correct" dates are just stored like this:

 

2008-07-04 02:26:00

2008-07-04 11:20:00

2008-07-05 12:44:00

2008-07-05 02:19:00

2008-07-06 01:59:00

2008-07-08 02:31:00

2008-07-09 01:32:00

 

...and so on, up to 751.  I would love to find an easy way to just be able to import this into the post_date column, but I can't find a way to replace the existing data.

 

Another option that I can think of is to make a long MySQL UPDATE query, but the only problem with this is that the unique ID in my WP table is unfortunately not completely unbroken.  It starts at 6 and goes all the way up to 802, which means there are about 50 rows missing along the way.

 

So I guess I have two questions.  One, if it's possible to "re-seat" the existing 751 rows, where they will be ID'd as 0-750, that would make it much easier to do some sort of a batch update, I would think.

 

The second option would be to just find a way to merge these 751 lines into the post_date column of the 751 rows in my table.

 

Any ideas on how this could be done?  I'm not incredibly proficient at MySQL, but I can get around in phpMyAdmin.  The main goal is simply to update the post_date field of the 751 preexisting rows, and put in the data from the 751 lines from the "corrected" file.

 

Thanks for reading this.  Any help would be appreciated!

 

Luke

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.