I'm pretty sure it can be done with a single query, using joins and an embedded select. I just haven't played around with it much yet. Just wondering if anyone else had anything similar.
EDIT: Got it worked out.
*** WARNING: USE AT YOUR OWN RISK. MAKE A BACKUP OF YOUR DATABASE FIRST. MAYBE TWO TO BE SAFE. NOT RESPONSIBLE. ***
This worked for me to update all the old post titles to "Re: [thread title]" if they were currently blank. If you have a lot of posts this can take a while to execute. I have about 365k posts and it took about 10 minutes.
The query:
Code:
UPDATE post SET post.title = concat("Re: ",(SELECT thread.title FROM thread WHERE thread.threadid = post.threadid)) WHERE post.title = ""