vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Query for deleting templates which have a prefix "X" (https://vborg.vbsupport.ru/showthread.php?t=49048)

geniuscrew 02-17-2003 11:05 PM

Query for deleting templates which have a prefix "X"
 
is it possible to do this? thanks

N!ck 02-17-2003 11:30 PM

i know you can do instr(), such as:

DELETE FROM table WHERE INSTR(field, 'string')

don't hold me to that, i might have the parameters backwards.

anyhow, check out the manual at http://www.mysql.com/

Xenon 02-17-2003 11:36 PM

hmm i think this one:

[sql]DELETE FROM template WHERE template LIKE (prefix%)[/sql]

but not 100% sure, use it on your own risk ;)

N!ck 02-18-2003 02:10 AM

i'm going to go out on a limb and say that Xenon is definitely correct...try it on a test table first though.

filburt1 02-18-2003 02:38 AM

I think you need quotes...or if you don't you probably should anyway:
[sql]
DELETE FROM template WHERE template LIKE "prefix%"
[/sql]
For example:
Code:

mysql> select userid,username from user where username like "filburt%";
+--------+----------+
| userid | username |
+--------+----------+
|      1 | filburt1 |
+--------+----------+
1 row in set (0.00 sec)


Xenon 02-18-2003 10:17 AM

yes filburt is right, quotes are needed

geniuscrew 02-18-2003 07:03 PM

Ahh OK - thanks everyone!

geniuscrew 02-18-2003 07:10 PM

Query with quotes don't work ppl

Xenon 02-18-2003 07:11 PM

use singelquotes :)

geniuscrew 02-18-2003 07:20 PM

Still not working :( - it says the query is a success though

Xenon 02-18-2003 07:31 PM

sorry, my fault, change the "template like" into "title like" ^^

geniuscrew 02-22-2003 08:21 PM

Oh thankyou - Xenon

Again :P

Xenon 02-23-2003 10:10 AM

welcome :)

gmarik 05-17-2003 08:22 PM

Thanks, Fil.


All times are GMT. The time now is 08:46 AM.

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.02108 seconds
  • Memory Usage 1,730KB
  • 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)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)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