Hey guys,Lemme just jump right in,I'm not the best with SQL commands within scripts,and was practicing recently,this is what I was going for....I created a table..
CREATE TABLE IF NOT EXISTS `reward_giver` (
`id` int(11) unsigned NOT NULL auto_increment,
`reward_id` int(11) NOT NULL,
`reward_amount` int(11) NOT NULL,
`reward_zeny` int(11) NOT NULL,
`char_id` int(11) NOT NULL,
`char_name` varchar(255) NOT NULL,
`collected` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM ;
And I wanted the max amount of slots to be used is 10.
set @nb,query_sql("INSERT INTO `reward_giver` VALUES(NULL,'"+ escape_sql(@reward_item) +"','"+ escape_sql(@reward_amount) +"','"+ escape_sql(@zeny_amount) +"','"+ escape_sql(@charid) +"','"+ escape_sql(@name$) +"','"+ escape_sql(@target$) +"','"+ escape_sql(@collected) +"')");
set $@reward_given,$@reward_given+1;
The thing I needed help with was this...after a reward is given,I want the slot to be emptied,and the rest of the slots to move up
So if I had slot 2,and I received I reward i want slot 3 to become slot 2,and slot 4 to become slot 3 so on and so forth.
I'd imagine I'd use the query_sql(UPDATE
command but..I'm not really sure...Thank you in advanced
Question
Pavi
Hey guys,Lemme just jump right in,I'm not the best with SQL commands within scripts,and was practicing recently,this is what I was going for....I created a table..
And I wanted the max amount of slots to be used is 10.
The thing I needed help with was this...after a reward is given,I want the slot to be emptied,and the rest of the slots to move up
So if I had slot 2,and I received I reward i want slot 3 to become slot 2,and slot 4 to become slot 3 so on and so forth.
I'd imagine I'd use the query_sql(UPDATE
command but..I'm not really sure...Thank you in advanced
Link to comment
Share on other sites
0 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.