VladimirCastro Posted June 29, 2013 Posted June 29, 2013 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; Quote
Capuche Posted June 29, 2013 Posted June 29, 2013 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 Quote
VladimirCastro Posted June 30, 2013 Author Posted June 30, 2013 i mean how can i make a sql database with that one? Quote
Patskie Posted July 2, 2013 Posted July 2, 2013 Like this? if so, add this on your script 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"; Quote
Question
VladimirCastro
heres my script.. of mvp i got error it says that db sql error mvp
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.