Quick SQL query question

Virtue

New member
Messages
259
Points
0
Hi All,

I need help with a quick SQL query script.

-    script    testcharname#Testserver    FAKE_NPC,{

OnInit:
bindatcmd("testingname","testcharname#Testserver::OnTestName",99);

OnTestName:
mes "GO";
input .@name$;
next;
query_sql "SELECT charid,name FROM `char` WHERE `name` = "+.@name$,.@charid,.@gname$;
    if(.@gname$ == .@name$){
    mes "Hey";
    dispbottom ("["+.@charid+"]",0x00FA9A);
    close;
    } else {
    mes "Hoy";
    dispbottom ("Character doesn't exist.",0x00FA9A);
    close;
    }
}


I need to get results if the input is valid, if not will display "character doesn't exist". Got no errors on script checker but script doesn't proceed. I think there's something wrong with my query and I'm not getting results

 
Solved this. LOL. very minor error. Should be char_id ,not charid. lol

 
Back
Top