Jump to content

[SOLVED] Duplicate information from one table to another, a better way?


Recommended Posts

MYSQL: 5.0.67

Level of Confidence: LOW

 

two tables share data

 

posts contains post_id, topic_id, forum_id

topics contains topic_id, forum_id

 

My problem is that the process I used to convert the data from one forum software to another has backfired and left posts.forum_id blank (default value - 0).

 

I can manually go through and edit every value of posts.forum_id to match up with the appropriate topics.forum_id because posts.topic_id and topics.topic_id are the same, but I am hoping that someone can save me the hours of manual work with a short mysql query that can look up topics.forum_id for each instance of posts.topic_id and write the correct values back into posts.forum_id

 

Any help would be greatly appreciated,

 

Thanks,

PW.

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.