Jump to content

Question

Posted

heres my script.. of mvp i got error it says that db sql error mvp 

 

 

    query_sql "SELECT `name` FROM `mvp` WHERE `char_id`="+getcharid(0)+"",.@name$;


    if ( .@name$ == "" ) { query_sql "INSERT INTO `mvp` (`char_id`,`name`,`kills`,`points`) VALUES (" + getcharid(0) + ",'" + escape_sql(strcharinfo(0)) + "',1,1)"; end; }


    query_sql "UPDATE `mvp` SET `kills` = (`kills` + 1), `points` = (`points` +1) WHERE `char_id`=" + getcharid(0);


    end;
 

 

 

3 answers to this question

Recommended Posts

Posted

Replace yours lines by this line

query_sql "INSERT INTO `mvp` VALUES (" + getcharid(0) + ",'" + escape_sql( strcharinfo(0) ) + "',1,1) on duplicate key update `kills` = `kills` + 1, `points` = `points` +1";

 

If you still have some error, report it

Posted

Like this? if so, add this on your script :D

OnInit:
query_sql "CREATE TABLE IF NOT EXISTS `mvp` (`char_id` INT(11) NOT NULL DEFAULT '0', `name` VARCHAR(30) NOT NULL DEFAULT '', `kills` INT NOT NULL DEFAULT '0', `points` INT NOT NULL DEFAULT '0') ENGINE=MyISAM";

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...