XF 1.1 Query To Add Prefix To All Threads in X Forum

Brent W

Well-known member
I need a query so that I can update all threads that reside in a certain forum with an existing thread prefix.
 
Thanks Jake. Where can I look up how to do a query?

Can a query do a series of forums in one go if the prefix added is the same
applying the prefix to a whole lot of forums?
 
You can run queries using phpmyadmin which is a program that many hosts will preinstall for you.

Here is a query to specify multiple nodes:

Code:
UPDATE xf_thread
SET prefix_id = 1
WHERE node_id IN (29,30,31,32);
 
Code:
UPDATE xf_thread
SET prefix_id = 1
WHERE node_id = 29;

You need to specify the prefix_id and node_id.


Hi Jake
I'd like to use this to change all prefixes on threads older than 6 months (or 180 days) old. Would I need to add :

and post_date < xxxxxxxxxxxx;

and work out the date code for 180 days ago ?
 
Hi Jake
I'd like to use this to change all prefixes on threads older than 6 months (or 180 days) old. Would I need to add :

and post_date < xxxxxxxxxxxx;

and work out the date code for 180 days ago ?

Try this:

Code:
UPDATE xf_thread
SET prefix_id = 1
WHERE node_id = 29
AND post_date < UNIX_TIMESTAMP() - (86400*180);
 
Top Bottom