vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need More Help Un-Doing Query (https://vborg.vbsupport.ru/showthread.php?t=93506)

dieselpowered 08-03-2005 05:29 AM

Need More Help Un-Doing Query
 
Hey everyone, alright, I need to remove this query from my database...what would be the correct command to run??

Quote:

INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('-1', 'saved_affiliate_x_successfully', '<i>{1}\'s</i> has been updates!', '9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('-1', 'deleted_affiliate_x_successfully', '<i>{1}</i> has been deleted!', '9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('-1', 'deleted_affiliate_x_unsuccessfully', '<i>{1}</i> was not deleted due to your choice selection.', '9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('-1', 'inserted_affiliate_x_successfully', '<i>{1}</i> has been successfully added to the data base.', '9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('-1', 'inserted_affiliate_x_unsuccessfully', 'This affiliates could not be added to the database because you either did not enter an affiliate name or an affiliate url or an affiliate email.', '9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('-1', 'saved_affiliate_settings_successfully', 'Settings for Affiliates Addon Updated.', '9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('-1', 'updated_affiliate_type_successfully', '<i>{1}</i> was updated successfully.', '9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('-1', 'updated_affiliate_type_unsuccessfully', 'The type was <u>not</u> updated because the types name was left blank.', '9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('-1', 'saved_affiliate_type_unsuccessfully', 'This type/category was not added to the database due to the name of this type/category not being filled in.', '9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('-1', 'saved_affiliate_type_successfully', '<i>{1}</i> was added to the database successfully.', '9000');
INSERT INTO phrase (languageid,varname,text,phrasetypeid) VALUES ('0', 'approved_affiliate_x_successfully', '<i>{1}</i> has been approved successfully and an email has been dispatched to its admin\'s email.', '9000');
Thank you!!

Marco van Herwaarden 08-03-2005 05:31 AM

[sql]DELETE FROM phrase WHERE varname = 'saved_affiliate_x_successfully';[/sql]

Repeat that for each phrase. (changing the name ofcourse).

Colin F 08-03-2005 05:32 AM

Quote:

Originally Posted by xtremeoff-road
Hey everyone, alright, I need to remove this query from my database...what would be the correct command to run??



Thank you!!

That would be more than one query :)

Run a query accordingly for each of the above.
[sql]DELETE FROM phrase WHERE varname = 'saved_affiliate_x_successfully' LIMIT 1;[/sql]

Exchange the varname each time

Marco van Herwaarden 08-03-2005 05:39 AM

Slooooooow Colin :) :D

PS That limit is not needed, and could even have undesired side effects.

dieselpowered 08-03-2005 05:42 AM

excellent...thank you guys!!! as always, appreciate the help :) I am sure I will have more questions, you must forgive my ignorance :)

Colin F 08-03-2005 05:47 AM

Quote:

Originally Posted by MarcoH64
Slooooooow Colin :) :D

PS That limit is not needed, and could even have undesired side effects.

Oh bugger off :p

Why could it have undesired side effects?

Marco van Herwaarden 08-03-2005 05:52 AM

If you have translations into other languages for that phrase, those would not be deleted. Only 1 (and since no ORDER BY is given, this is arbitrary) phrase will get removed.

dieselpowered 08-03-2005 06:18 AM

Hi there...sorry me again...alright I need to undo a bunch of these:

Quote:

$DB_site->query("INSERT INTO ".TABLE_PREFIX."phrase (languageid, varname, text, phrasetypeid) VALUES (0, 'tratings', 'Trader Ratings', 1)");
So how would that look?? Like this:

DELETE FROM phrase WHERE varname = 'tratings', ;Trader Ratings';

Thanks for the help!!

Marco van Herwaarden 08-03-2005 06:22 AM

Just:
[sql]DELETE FROM phrase WHERE varname = 'tratings'[/sql]

dieselpowered 08-03-2005 06:47 AM

LOL I am sorry, what would these be?

Quote:

$DB_site->query("ALTER TABLE ".TABLE_PREFIX."user ADD ratetradetotal SMALLINT(5) DEFAULT '0' NOT NULL");

$DB_site->query("ALTER TABLE ".TABLE_PREFIX."user ADD INDEX ratetradetotal (ratetradetotal)");
I very much appreciate your help!

I was thinking it would be:

ALTER TABLE user DROP ratetradetotal;

ALTER TABLE user DROP INDEX ratetradetotal ;

Marco van Herwaarden 08-03-2005 07:06 AM

Correct

dieselpowered 08-03-2005 07:08 AM

Hmmm says it cannot drop:

ALTER TABLE user DROP INDEX ratetradetotal;

Nevermind, looks like when I dropped the first one, it dropped the second?? Would it have done that?

Colin F 08-03-2005 07:41 AM

Quote:

Originally Posted by xtremeoff-road
Hmmm says it cannot drop:

ALTER TABLE user DROP INDEX ratetradetotal;

Nevermind, looks like when I dropped the first one, it dropped the second?? Would it have done that?

I don't know MySQL that well, but I'd say that's possible, as it's an index on the table and doesn't make sense to keep that if the table itself isn't around anymore.

Marco van Herwaarden 08-03-2005 08:06 AM

Yes, the index is based on that column, so if you drop the column the index also get dropped.

dieselpowered 08-03-2005 03:23 PM

WOOHOO I am an SQL genious!!! :)

Thanks guys for taking the time to help...have a great one!


All times are GMT. The time now is 12:45 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.03033 seconds
  • Memory Usage 1,746KB
  • 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
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)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