Brent W Well-known member May 20, 2012 #1 I need a query so that I can update all threads that reside in a certain forum with an existing thread prefix.
I need a query so that I can update all threads that reside in a certain forum with an existing thread prefix.
Jake Bunce Well-known member May 21, 2012 #2 Code: UPDATE xf_thread SET prefix_id = 1 WHERE node_id = 29; You need to specify the prefix_id and node_id. Upvote 0 Downvote
Code: UPDATE xf_thread SET prefix_id = 1 WHERE node_id = 29; You need to specify the prefix_id and node_id.
Brent W Well-known member May 23, 2012 #3 Jake Bunce said: Code: UPDATE xf_thread SET prefix_id = 1 WHERE node_id = 29; You need to specify the prefix_id and node_id. Click to expand... It's odd that you ad the exact query I needed to run, from prefix_id to node_id lol Upvote 0 Downvote
Jake Bunce said: Code: UPDATE xf_thread SET prefix_id = 1 WHERE node_id = 29; You need to specify the prefix_id and node_id. Click to expand... It's odd that you ad the exact query I needed to run, from prefix_id to node_id lol
Morgain Well-known member Sep 18, 2012 #4 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? Upvote 0 Downvote
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?
Jake Bunce Well-known member Sep 18, 2012 #5 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); Upvote 0 Downvote
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);
webroxau Active member Jan 15, 2013 #7 Jake Bunce said: Code: UPDATE xf_thread SET prefix_id = 1 WHERE node_id = 29; You need to specify the prefix_id and node_id. Click to expand... 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 ? Upvote 0 Downvote
Jake Bunce said: Code: UPDATE xf_thread SET prefix_id = 1 WHERE node_id = 29; You need to specify the prefix_id and node_id. Click to expand... 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 ?
Jake Bunce Well-known member Jan 17, 2013 #8 graham_w said: 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 ? Click to expand... Try this: Code: UPDATE xf_thread SET prefix_id = 1 WHERE node_id = 29 AND post_date < UNIX_TIMESTAMP() - (86400*180); Upvote 0 Downvote
graham_w said: 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 ? Click to expand... Try this: Code: UPDATE xf_thread SET prefix_id = 1 WHERE node_id = 29 AND post_date < UNIX_TIMESTAMP() - (86400*180);