vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Query Help With A Mod (https://vborg.vbsupport.ru/showthread.php?t=94553)

paul41598 08-18-2005 11:29 AM

Query Help With A Mod
 
I have that prefix category hack installed for 3.0.7 and it works great. I imported recently from Ubb.Classic. I want to assign a category to all my threads in a forum that have "roommate" in the thread title.

I need a query to do this else I have to edit 17 pages worth of threads. :(

I know a few things to get started. The table to be updated is 'thread' and I would be updating the 'title' , and 'category' fields.

Id like to know how to select all threads in forumid 17, with "roommate" in their title. THen I need to update all those threads and set the category = "roommate"

Any ideeas? or does that make sense?

Marco van Herwaarden 08-18-2005 11:47 AM

Probably something like:
[sql]UPDATE thread SET category='roommate'
WHERE forumid=17 AND title LIKE '%roommate%';[/sql]

paul41598 08-18-2005 02:28 PM

ok now I havnt tried it yet, but the select statement worked with what u said.

Before I try that, how can I alter that statement to include like '%roommate%', '%roomate%', etc. Just difference variations of it, in case some titles are mispelled.

Marco van Herwaarden 08-18-2005 07:38 PM

Just run it twice with the other options.

soniceffect 08-18-2005 07:55 PM

Someone please correct me if this is wrong as I`ve had a few to drink ... But this is another way of doing it in one. Just add as many variations as you need.

[sql]
UPDATE thread SET category='roommate'
WHERE forumid=17 AND title IN
(SELECT category FROM thread WHERE title like %roommate% OR %roomate% OR %rommate%)
[/sql]


All times are GMT. The time now is 04:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01005 seconds
  • Memory Usage 1,708KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete