Jump to content
  • 0
Anime s2

sql query eathena -> rathena

Question

Some commands that stopped working after I migrated to  rathena

 

eathena:

query_sql("SELECT `account_id` FROM `char` WHERE `name`='"[email protected]$+"'",#ACCOUNT__ID);

 

query_sql "UPDATE `login` SET `BLOCK_PJ` = '0' WHERE `account_id` = '"+#ACCOUNT__ID+"'";

 

query_sql ("SELECT `BLOCK_PJ` FROM `login` WHERE `account_id`='"+getcharid(3)+"'", [email protected]$);

 

query_sql "INSERT INTO `broadcast`(`name`,`last__broadcast`) VALUES ('"+strcharinfo(0)+"','"[email protected]$+"')";

 

query_sql ("SELECT `name`,`last__broadcast` FROM `broadcast` ORDER BY `ID__MSJ` DESC LIMIT 10", [email protected]$[0] , [email protected]$[0]);

 

query_sql "SELECT `char`.char_id,`char`.`name`,global_reg_value.`value` FROM global_reg_value LEFT JOIN `char` ON global_reg_value.char_id=`char`.char_id WHERE global_reg_value.str='fallsdoei' ORDER BY CAST(`global_reg_value`.`value` AS UNSIGNED) DESC LIMIT 10", [email protected]_id, [email protected]$, [email protected];

 

set @nb,query_sql("INSERT INTO `itemizer` VALUES(NULL,'"+ escape_sql(@ep_item_id) +"','"+ escape_sql(@ep_item_count) +"','"+ escape_sql(getitemname(@ep_item_id)) +"','"+ escape_sql(getcharid(0)) +"','"+ escape_sql(strcharinfo(0)) +"','N/A','"+ escape_sql(strcharinfo(0)) +"','"+ escape_sql(@when$) +"','gm','1')");

 

set @result,query_sql("SELECT `id`,`item_id`,`item_name`,`item_amount`,`reason`,`by_gm` FROM `itemizer` WHERE (`char_id` = '"+ getcharid(0) +"' AND `for` = 'player' AND `collected` = 0) LIMIT 127",

 

set @nb,query_sql("UPDATE `itemizer` SET `collected` = 1 WHERE (`id` = '"+ @db_id[@choice] +"') LIMIT 1");

 

set @result,query_sql("SELECT `item_name`,`item_amount`,`reason`,`by_gm`,`when` FROM `itemizer` WHERE (`char_id` = '"+ getcharid(0) +"' AND `for` = 'player' AND `collected` = 1) ORDER BY `when` DESC LIMIT "+ @offset +","+ @rows_per_page,

 

query_sql "SELECT `guild_lv` FROM `guild` WHERE `guild_id` = '"+ [email protected]_id +"'",[email protected]_lv;

 

query_sql "SELECT `guild_id` FROM `guild` WHERE `name` = '" +escape_sql([email protected]$) +"'", [email protected];

 

        query_sql "SELECT `char`.char_id,`char`.`name`,global_reg_value.`value` FROM global_reg_value LEFT JOIN `char` ON global_reg_value.char_id=`char`.char_id WHERE global_reg_value.str='bempcount' ORDER BY CAST(`global_reg_value`.`value` AS UNSIGNED) DESC LIMIT 10", [email protected]_id, [email protected]$, [email protected];

        query_sql "SELECT `char`.char_id,`char`.`name`,global_reg_value.`value` FROM global_reg_value LEFT JOIN `char` ON global_reg_value.char_id=`char`.char_id WHERE global_reg_value.str='showbrokeemp' ORDER BY CAST(`global_reg_value`.`value` AS UNSIGNED) DESC LIMIT 10", [email protected]_id, [email protected]$, [email protected];

 

query_sql "SELECT COUNT(castle_id) FROM guild_castle WHERE guild_id="+getcharid(2), [email protected];

 

query_sql "select account_id from `char` where online = 1 order by rand() limit 1", [email protected];

 

db is complete with all the tables (eAthena + rathena+custom)

 

sry for my bad english

Anyone?

Edited by Anime s2
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

https://rathena.org/board/topic/102946-script-engine-upgrade/

You only need to update the query for global_reg_value the others query should working

 

https://rathena.org/board/topic/102946-script-engine-upgrade/

You only need to update the query for global_reg_value the others query should working

Done, but still bugged.

                set [email protected],1101;

                query_sql "SELECT `slots` FROM `item_db` WHERE `id` = '"[email protected]+"'"[email protected];

 

// [email protected] = sword [5]

 

Result: show "0" slots ([email protected])

Edited by Anime s2
Link to comment
Share on other sites

ok, i found a way to get item slot. (getiteminfo)

 

                set [email protected],5013;
                query_sql "SELECT refineable FROM item_db WHERE id = '"[email protected]+"'",[email protected];
                mes [email protected]; )

 

query_sql "SELECT `slots` FROM `item_db` WHERE `id` = '"[email protected]+"'"[email protected];

to

query_sql "SELECT slots FROM item_db WHERE id = "[email protected]+";",[email protected];

ok, i found a way to get item slot. (getiteminfo)

 

           @Promise

 

                set [email protected],5013;
                query_sql "SELECT refineable FROM item_db WHERE id = '"[email protected]+"'",[email protected];
                mes [email protected]; (show 0)

Link to comment
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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.