VladimirCastro Posted June 29, 2013 Group: Members Topic Count: 114 Topics Per Day: 0.02 Content Count: 298 Reputation: 4 Joined: 03/13/12 Last Seen: September 18, 2016 Share 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 Link to comment Share on other sites More sharing options...
Capuche Posted June 29, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
VladimirCastro Posted June 30, 2013 Group: Members Topic Count: 114 Topics Per Day: 0.02 Content Count: 298 Reputation: 4 Joined: 03/13/12 Last Seen: September 18, 2016 Author Share Posted June 30, 2013 i mean how can i make a sql database with that one? Quote Link to comment Share on other sites More sharing options...
Patskie Posted July 2, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 3 hours ago Share 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 Link to comment Share on other sites More sharing options...
Question
VladimirCastro
heres my script.. of mvp i got error it says that db sql error mvp
Link to comment
Share on other sites
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.