• 0
celeron0134

How to add .sql on phpmyadmin

Question

good day rathena.. i tried this

/*
DROP TABLE IF EXISTS `pvp_ranking`;

CREATE TABLE IF NOT EXISTS `pvp_ranking` (
`Char_ID` int(11) unsigned NOT NULL DEFAULT '0',
`PlayerName` varchar(255) NULL DEFAULT '',
`Kills` varchar(255) NULL DEFAULT '',
`Deaths` varchar(255) NULL DEFAULT '',
PRIMARY KEY (`Char_ID`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `woe_ranking`;

CREATE TABLE IF NOT EXISTS `woe_ranking` (
`Char_ID` int(11) unsigned NOT NULL DEFAULT '0',
`PlayerName` varchar(255) NULL DEFAULT '',
`Kills` varchar(255) NULL DEFAULT '',
`Deaths` varchar(255) NULL DEFAULT '',
`EmpBreak` varchar(255) NULL DEFAULT '',
PRIMARY KEY (`Char_ID`)
) ENGINE=MyISAM;
*/

i copied and saved it as .sql, then open my phpmyadmin, clicked on ragnarok then clicked import.. i chose the file.sql then pressed go.. and i just see this

sqlll.PNG

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
5 hours ago, celeron0134 said:

good day rathena.. i tried this

/*
DROP TABLE IF EXISTS `pvp_ranking`;

CREATE TABLE IF NOT EXISTS `pvp_ranking` (
`Char_ID` int(11) unsigned NOT NULL DEFAULT '0',
`PlayerName` varchar(255) NULL DEFAULT '',
`Kills` varchar(255) NULL DEFAULT '',
`Deaths` varchar(255) NULL DEFAULT '',
PRIMARY KEY (`Char_ID`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `woe_ranking`;

CREATE TABLE IF NOT EXISTS `woe_ranking` (
`Char_ID` int(11) unsigned NOT NULL DEFAULT '0',
`PlayerName` varchar(255) NULL DEFAULT '',
`Kills` varchar(255) NULL DEFAULT '',
`Deaths` varchar(255) NULL DEFAULT '',
`EmpBreak` varchar(255) NULL DEFAULT '',
PRIMARY KEY (`Char_ID`)
) ENGINE=MyISAM;
*/

i copied and saved it as .sql, then open my phpmyadmin, clicked on ragnarok then clicked import.. i chose the file.sql then pressed go.. and i just see this

sqlll.PNG

this is table from ranking npc? just talk to the npc it will automatically create pvp_ranking and woe_ranking table.

Share this post


Link to post
Share on other sites
  • 0
37 minutes ago, BeWan said:

this is table from ranking npc? just talk to the npc it will automatically create pvp_ranking and woe_ranking table.

yeah.. i talked to the npc and nothing happens

Share this post


Link to post
Share on other sites
  • 0

remove the comment in your SQL file

/*    <--- REMOVE
...
...
*/    <--- REMOVE

 

Share this post


Link to post
Share on other sites
  • 0
17 hours ago, Emistry said:

remove the comment in your SQL file

/*    <--- REMOVE
...
...
*/    <--- REMOVE

 

did it.. copied the whole txt and removed what you said.. and saved it as .sql then opened phpmyadmin, clicked ragnarok then import then chosed the file.. then pressed go.. it says executed 4 queries.. but when i clicked pvp_ranking and woe_ranking this is the result

2nd sql.PNG

 

//===== rAthena Script =======================================
//= Ranking List
//===== By: ==================================================
//= BeWan
//https://rathena.org/board/profile/62232-bewan/
//===== Current Version: =====================================
//= 1.2
//===== Description: =========================================
//= PvP/GvG/Emperium Breaker Ranking List
//= Top 10 Kills, Deaths and Break Emp
//= PvP/GvG/Emp Break Shop Added
//============================================================

/*
DROP TABLE IF EXISTS `pvp_ranking`;

CREATE TABLE IF NOT EXISTS `pvp_ranking` (
`Char_ID` int(11) unsigned NOT NULL DEFAULT '0',
`PlayerName` varchar(255) NULL DEFAULT '',
`Kills` varchar(255) NULL DEFAULT '',
`Deaths` varchar(255) NULL DEFAULT '',
PRIMARY KEY (`Char_ID`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `woe_ranking`;

CREATE TABLE IF NOT EXISTS `woe_ranking` (
`Char_ID` int(11) unsigned NOT NULL DEFAULT '0',
`PlayerName` varchar(255) NULL DEFAULT '',
`Kills` varchar(255) NULL DEFAULT '',
`Deaths` varchar(255) NULL DEFAULT '',
`EmpBreak` varchar(255) NULL DEFAULT '',
PRIMARY KEY (`Char_ID`)
) ENGINE=MyISAM;
*/

prontera,153,190,4	script	Krane The Ranker	417,{

	set [email protected]$, "PvP Rank:GvG Rank:Guild Rank:Points Shop:";
	if (getgmlevel() == 99) { set [email protected]$, [email protected]$ + "Reset Data"; }
	switch(select([email protected]$)) {
	case 1:
	mes "[Master Krane]";
	mes "Hi, "+strcharinfo(0)+"";
	mes "If you want to I can show you";
	mes "PVP Top "+.top+" Strongest and the Weakest.";
	next;
	menu "Top "+.top+" Kills",PvPKills,"Top "+.top+" Weakest",PvPDeaths,"Nope",PvPNope;

	PvPKills:
	query_sql "CREATE TABLE IF NOT EXISTS `pvp_ranking` ( `Char_ID` int(11) unsigned NOT NULL DEFAULT '0', `PlayerName` varchar(255) NULL DEFAULT '', `Kills` varchar(255) NULL DEFAULT '', `Deaths` varchar(255) NULL DEFAULT '', PRIMARY KEY (`Char_ID`) ) ENGINE=MyISAM";
	query_sql( "DELETE FROM `pvp_ranking` WHERE `PlayerName` NOT IN ( SELECT `name` FROM `char` )" ); 
	set [email protected], query_sql( "SELECT * FROM pvp_ranking WHERE Kills > 0 ORDER BY Kills DESC limit "+ .top, [email protected], [email protected]$, [email protected], [email protected]);
	
	mes "[^FF0000PvP ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
	for (set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1)
		mes "Top ^FF0000" +([email protected] + 1) +"^000000: ^0000FF" + [email protected]$[[email protected]] +"^000000 | ^FF0000" + [email protected][[email protected]] +"^000000 Kills | ^FF0000" + [email protected][[email protected]] +"^000000 Deaths";
	close;
	
	PvPDeaths:
	query_sql "CREATE TABLE IF NOT EXISTS `pvp_ranking` ( `Char_ID` int(11) unsigned NOT NULL DEFAULT '0', `PlayerName` varchar(255) NULL DEFAULT '', `Kills` varchar(255) NULL DEFAULT '', `Deaths` varchar(255) NULL DEFAULT '', PRIMARY KEY (`Char_ID`) ) ENGINE=MyISAM";
	query_sql( "DELETE FROM `woe_ranking` WHERE `PlayerName` NOT IN ( SELECT `name` FROM `char` )" ); 
	set [email protected], query_sql( "SELECT * FROM pvp_ranking WHERE Deaths > 0 ORDER BY Deaths DESC limit "+ .top, [email protected], [email protected]$, [email protected], [email protected]);
	
	mes "[^FF0000WoE ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
	for (set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1)
		mes "Top ^FF0000" +([email protected] + 1) +"^000000: ^0000FF" + [email protected]$[[email protected]] +"^000000 | ^FF0000" + [email protected][[email protected]] +"^000000 Kills | ^FF0000" + [email protected][[email protected]] +"^000000 Deaths ";
	close;
	
	PvPNope:
	mes "[Master Krane]";
	mes "Well Okay";
	close;
	
	case 2:
	mes "[Master Krane]";
	mes "Hi, "+strcharinfo(0)+"";
	mes "If you want to I can show you";
	mes "GVG Top "+.top+" Strongest/Weakest and the Emperium Breaker.";
	next;
	menu "Top "+.top+" Kills",GvGKills,"Top "+.top+" Weakest",GvGDeaths,"Top "+.top+" Breaker",EmpBreak,"Nope",GvGNope;
	
	GvGKills:
	query_sql "CREATE TABLE IF NOT EXISTS `woe_ranking` ( `Char_ID` int(11) unsigned NOT NULL DEFAULT '0', `PlayerName` varchar(255) NULL DEFAULT '', `Kills` varchar(255) NULL DEFAULT '', `Deaths` varchar(255) NULL DEFAULT '', `EmpBreak` varchar(255) NULL DEFAULT '', PRIMARY KEY (`Char_ID`) ) ENGINE=MyISAM";
	query_sql( "DELETE FROM `woe_ranking` WHERE `PlayerName` NOT IN ( SELECT `name` FROM `char` )" ); 
	set [email protected], query_sql( "SELECT * FROM woe_ranking WHERE Kills > 0 ORDER BY Kills DESC limit "+ .top, [email protected], [email protected]$, [email protected], [email protected], [email protected]);
	
	mes "[^FF0000WoE ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
	for (set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1)
		mes "Top ^FF0000" +([email protected] + 1) +"^000000: ^0000FF" + [email protected]$[[email protected]] +"^000000 | ^FF0000" + [email protected][[email protected]] +"^000000 Kills | ^FF0000" + [email protected][[email protected]] +"^000000 Deaths | ^FF0000" + [email protected][[email protected]] +"^000000 Emp Break ";
	close;
	
	GvGDeaths:
	query_sql "CREATE TABLE IF NOT EXISTS `woe_ranking` ( `Char_ID` int(11) unsigned NOT NULL DEFAULT '0', `PlayerName` varchar(255) NULL DEFAULT '', `Kills` varchar(255) NULL DEFAULT '', `Deaths` varchar(255) NULL DEFAULT '', `EmpBreak` varchar(255) NULL DEFAULT '', PRIMARY KEY (`Char_ID`) ) ENGINE=MyISAM";
	query_sql( "DELETE FROM `woe_ranking` WHERE `PlayerName` NOT IN ( SELECT `name` FROM `char` )" ); 
	set [email protected], query_sql( "SELECT * FROM woe_ranking WHERE Deaths > 0 ORDER BY Deaths DESC limit "+ .top, [email protected], [email protected]$, [email protected], [email protected], [email protected]);
	
	mes "[^FF0000WoE ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
	for (set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1)
		mes "Top ^FF0000" +([email protected] + 1) +"^000000: ^0000FF" + [email protected]$[[email protected]] +"^000000 | ^FF0000" + [email protected][[email protected]] +"^000000 Kills | ^FF0000" + [email protected][[email protected]] +"^000000 Deaths | ^FF0000" + [email protected][[email protected]] +"^000000 Emp Break";
	close;
	
	EmpBreak:
	query_sql "CREATE TABLE IF NOT EXISTS `woe_ranking` ( `Char_ID` int(11) unsigned NOT NULL DEFAULT '0', `PlayerName` varchar(255) NULL DEFAULT '', `Kills` varchar(255) NULL DEFAULT '', `Deaths` varchar(255) NULL DEFAULT '', `EmpBreak` varchar(255) NULL DEFAULT '', PRIMARY KEY (`Char_ID`) ) ENGINE=MyISAM";
	query_sql( "DELETE FROM `woe_ranking` WHERE `PlayerName` NOT IN ( SELECT `name` FROM `char` )" ); 
	set [email protected], query_sql( "SELECT * FROM woe_ranking WHERE EmpBreak > 0 ORDER BY EmpBreak DESC limit "+ .top, [email protected], [email protected]$, [email protected], [email protected], [email protected]);
	query_sql "SELECT `name`, `guild_id` FROM `char` WHERE `name` = '"[email protected]$+"'", [email protected]$, [email protected];
	
	mes "[^FF0000WoE ^0000FFRank ^996600Top ^FF0000" + .top +"^000000]";
	for (set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1)
		mes "Top ^FF0000" +([email protected] + 1) +"^000000: ^0000FF" + [email protected]$[[email protected]] +"^000000 | ^FF0000" + [email protected][[email protected]] +"^000000 Kills | ^FF0000" + [email protected][[email protected]] +"^000000 Deaths | ^FF0000" + [email protected][[email protected]] +"^000000 Emp Break";
	close;
	
	GvGNope:
	mes "[Master Krane]";
	mes "Well Okay";
	close;
	
	case 3:
	for (set [email protected],0; [email protected] < .top; set [email protected],[email protected] + 1) {
		if ([email protected]) mes "- - - - - - - - - - - - - - -";
		mes "# ^ff0000" + ([email protected] + 1) + "^000000: ^0000ff" + ( (.GuildName$[[email protected]])? .GuildName$[[email protected]]:"None" ) + "^000000";
		mes " - Guild Master: ^0000ff" + ( (.GuildMaster$[[email protected]])? .GuildMaster$[[email protected]]:"None" ) + "^000000";
		mes " - Territories: ^ff0000" + .NumCastles[[email protected]] + "^000000";
		mes " - Members: ^ff0000" + .NumMembers[[email protected]] + "^000000";
	}
	end;
	
	case 4:
	mes "[Master Krane]";
	mes "Hi, "+strcharinfo(0)+"";
	mes "Want to go shopping?";
	next;
	menu "PvP Shop",PvPShop,"GvG Shop",GvGShop,"Emp Break Shop",BreakShop,"Nope",ShopNope;
	
	PvPShop:
	callshop "PvP_Points_Shop",1;
	end;
	
	GvGShop:
	callshop "GvG_Points_Shop",1;
	end;
	
	BreakShop:
	callshop "EmpBreak_Points_Shop",1;
	end;
	
	ShopNope:
	mes "[Master Krane]";
	mes "Well Okay";
	close;
	
	case 5:
	mes "[Master Krane]";
	mes "Good Day!";
	next;
	menu "PvP Ranking Reset",PvPReset,"GvG Ranking Reset",GvGReset,"Nope",No;
	
	PvPReset:
	mes "[Master Krane]";
	mes "PvP Ranking Reset?";
	menu "Are you sure?",PvPYes,"Nope",PvPNo;
	
	PvPYes:
	query_sql("TRUNCATE TABLE `ragnarok`.`pvp_ranking`;");
	mes "PvP Rank Reset Success";
	close;
	
	PvPNo:
	mes "[Master Krane]";
	mes "Well Okay";
	close;
	
	GvGReset:
	mes "[Master Krane]";
	mes "GvG Ranking Reset?";
	menu "Are you sure?",GvGYes,"Nope",GvGNo;
	
	GvGYes:
	query_sql("TRUNCATE TABLE `ragnarok`.`woe_ranking`;");
	mes "GvG Rank Reset Success";
	close;
	
	GvGNo:
	mes "[Master Krane]";
	mes "Well Okay";
	close;
	
	No:
	mes "[Master Krane]";
	mes "Well Okay";
	close;

	}

OnInit: // Script Configuration
	set .Cnt, query_sql("SELECT (SELECT count(c.castle_id) FROM guild_castle c WHERE c.guild_id = g.guild_id) castles, CONCAT(g.name, ' (LV. ',g.guild_lv,')') guild, count(g.char_id) members, g.master FROM guild g LEFT JOIN guild_member m ON g.guild_id = m.guild_id GROUP BY g.guild_id HAVING castles > 0 ORDER BY castles DESC, guild_lv DESC, members DESC", .NumCastles,.GuildName$,.NumMembers,.GuildMaster$);
	set .PvP_Point, 1;    //PvP Points to add when kill
	set .PvP_Deductpoint, 1; //PvP Points to deduct when died
	set .WoePoints, 1;      //WoE points to add in database/player when kill
	set .WoeDeduct, 1;      //Woe points to add in database
	set .diedeductpoint, 1; //Woe points to deduct when died
	set .top, 5;
	waitingroom "PvP/GvG Rank List",0;
	end;

OnPCKillEvent:
	if (killerrid != getcharid(3)) {
	if (( agitcheck() || agitcheck2() ) && compare(strcharinfo(3),"g_cas")) {
		set points, points+.WoePoints;
		query_sql( "SELECT * FROM woe_ranking WHERE `Char_ID` = '"+getcharid(0)+"'", [email protected], [email protected]$, [email protected], [email protected], [email protected]);
		set ToTalP , [email protected] + .WoePoints;
		
	if(getcharid(0) == [email protected]){
		query_sql("UPDATE `woe_ranking` SET `Kills` = '"+ToTalP+"' WHERE `Char_ID` = '"+getcharid(0)+"'");
	}else{	
		query_sql("INSERT INTO `woe_ranking` (`Char_ID`,`PlayerName`,`Kills`,`Deaths`,`EmpBreak`) VALUES ('"+getcharid(0)+"', '"+strcharinfo(0)+"', '"+.WoePoints+"', '"[email protected]+"', '"[email protected]+"')"); 
	}
	////////query for the deaths
		query_sql( "SELECT `char_id`, `account_id` FROM `char` WHERE `account_id` =  '"+killedrid+"' ", [email protected]_id, [email protected]);
		query_sql( "SELECT * FROM woe_ranking WHERE `Char_ID` = '"[email protected]_id+"'", [email protected], [email protected]$, [email protected], [email protected], [email protected]);
		set TotalD , [email protected] + .WoeDeduct;
	
	if([email protected] != [email protected]_id){
		query_sql("INSERT INTO `woe_ranking` (`Char_ID`,`PlayerName`,`Kills`,`Deaths`,`EmpBreak`) VALUES ('"[email protected]_id+"', '"+strcharinfo(0)+"', '0', '"+TotalD+"', '"[email protected]+"')");
	}else{
		query_sql("UPDATE woe_ranking SET Deaths = '"+TotalD+"' WHERE `Char_ID` = '"[email protected]_id+"'");
	}	
	
	//This is the point system on the player, you can disable this anytime by adding comment " // "
		dispbottom "You killed "+rid2name(killedrid)+" you gained "+.WoePoints+" point and You now have "+Points+" Woe Points.";
		attachrid(killedrid);
		set points, points-.diedeductpoint;
		dispbottom "You are killed by "+rid2name(killerrid)+" you lost "+.diedeductpoint+" points and You now have "+Points+" Woe Points.";

	end;
	///////
	}else if(strcharinfo(3) == "guild_vs3"){ // This is PVP MAP restriction
	if(getcharid(3)==killedrid) end;
		set PvPpoints, PvPpoints+.PvP_Point;
		query_sql( "SELECT * FROM pvp_ranking WHERE `Char_ID` = '"+getcharid(0)+"'", [email protected], [email protected]$, [email protected], [email protected]);
		set ToTalPvPoints , [email protected] + .PvP_Point;
		
	if(getcharid(0) == [email protected]){
		query_sql("UPDATE `pvp_ranking` SET `Kills` = '"+ToTalPvPoints+"' WHERE `Char_ID` = '"+getcharid(0)+"'");
	}else{	
		query_sql("INSERT INTO `pvp_ranking` (`Char_ID`,`PlayerName`,`Kills`,`Deaths`) VALUES ('"+getcharid(0)+"', '"+strcharinfo(0)+"', '"+.PvP_Point+"', '"[email protected]+"')"); 
	}
		
		//This is the point system on the player, you can disable this anytime by adding comment " // "
		dispbottom "You killed "+rid2name(killedrid)+" you gained "+.PvP_Point+" point and You now have "+PvPpoints+" PVP Points.";
		attachrid(killedrid);
		set PvPpoints, PvPpoints-.PvP_Deductpoint;
		dispbottom "You are killed by "+rid2name(killerrid)+" you lost "+.PvP_Deductpoint+" Points and You now have "+PvPpoints+" PVP Points.";
		
		////////query for the deaths
		query_sql( "SELECT `char_id`, `account_id` FROM `char` WHERE `account_id` =  '"+getcharid(3)+"' ", [email protected]_id, [email protected]);
		query_sql( "SELECT * FROM pvp_ranking WHERE `Char_ID` = '"[email protected]_id+"'", [email protected], [email protected]$, [email protected], [email protected]);
		set ToTalDeathPvPoints , [email protected] + .PvP_Deductpoint;
		
	if([email protected] != [email protected]_id){
		query_sql("INSERT INTO `pvp_ranking` (`Char_ID`,`PlayerName`,`Kills`,`Deaths`) VALUES ('"[email protected]_id+"', '"+strcharinfo(0)+"', '0', '"+ToTalDeathPvPoints+"')");
	}else{
		query_sql("UPDATE pvp_ranking SET Deaths = '"+ToTalDeathPvPoints+"' WHERE `Char_ID` = '"[email protected]_id+"'");
	}
		end;
	}
    }
	end;
}

-	pointshop	PvP_Points_Shop	-1,PvPpoints,607:5,608:10
-	pointshop	GvG_Points_Shop	-1,points,1202:5;
-	pointshop	EmpBreak_Points_Shop	-1,ToTalB,2311:10

this is the whole script by @BeWan

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.