Valor Posted April 14, 2017 Posted April 14, 2017 hi, im testing this to check mvp card existence query_sql "SELECT `DropCardid` FROM `mob_db_re` WHERE `MEXP` != 0 ",.@mvpcard$; query_sql "SELECT `char_id` FROM `inventory` WHERE `nameid` = '"+.@mvpcard$+"' OR `card0` = '"+.@mvpcard$+"' OR `card1` = '"+.@mvpcard$+"' OR `card2` = '"+.@mvpcard$+"' OR `card3` = '"+.@mvpcard$+"'",.@mcid$; .@totalmvp = getarraysize(.@mcid$); mes "Total MvP Cards: ^990000" + .@totalmvp +"^000000"; but the result always 0 what did i miss or wrong? thx Quote
0 Secrets Posted April 14, 2017 Posted April 14, 2017 .@rst = query_sql("SELECT inventory.card0, inventory.card1, inventory.card2, inventory.card3 FROM inventory INNER JOIN mob_db_re ON inventory.card0 = mob_db_re.dropcardid OR inventory.card1 = mob_db_re.dropcardid OR inventory.card2 = mob_db_re.dropcardid OR inventory.card3 = mob_db_re.dropcardid WHERE mob_db_re.mexp != 0 AND mob_db_re.dropcardid != 0", .@card0, .@card1, .@card2, .@card3); if(.@rst == -1) { //query error end; } mes "Total items with MVP cards :" + .@rst; // Use .@card0 - .@card4 to do whatever you want 1 Quote
0 wonderman Posted April 14, 2017 Posted April 14, 2017 (edited) try to join 2 table sir Edited April 14, 2017 by wonderman nvm Quote
0 Valor Posted April 14, 2017 Author Posted April 14, 2017 Thanks @Secrets // valor trial: simple query mvp card on gears // thanks to Secrets // command: @mvp - script mvpcardcheck -1,{ OnInIt: bindatcmd "mvp",strnpcinfo(0)+"::OnCommand",99; end; OnCommand: .@rst = query_sql("SELECT inventory.char_id, inventory.nameid, inventory.refine, inventory.card0 FROM inventory INNER JOIN mob_db_re ON inventory.card0 = mob_db_re.dropcardid WHERE mob_db_re.mexp != 0 AND mob_db_re.dropcardid != 0", .@cid, .@itemid, .@refine, .@card0); for ( .@i = 0; .@i < .@rst; .@i++ ){ dispbottom .@i+1+"."+strcharinfo(0,.@cid[.@i])+" has +"+.@refine[.@i]+" "+getitemname(.@itemid[.@i])+" ["+getitemname(.@card0[.@i])+"] "; } end; } maybe someone need 1 Quote
Question
Valor
hi, im testing this to check mvp card existence
but the result always 0
what did i miss or wrong? thx
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.