[Help] Rebirth system mysql error...

Newbie Spellweaver
Joined
Jun 11, 2009
Messages
10
Reaction score
0
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+ 1;
end if;
if new.class=17 and new.level=120 then
set new.class=' at line 8

:blink::blink::blink:
 
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+ 1;
end if;
if new.class=17 and new.level=120 then
set new.class=' at line 8

:blink::blink::blink:

Code:
begin
		if new.class=6 and new.level=120 then 
                    set new.class=16;
                    set new.level=60;
                    set new.exp=0;
		end if;
		if new.class=7 and new.level=120 then 
	    set new.class=17;
                    set new.level=60;
                    set new.exp=0;
		end if;
		if new.class=8 and new.level=120 then 
	    set new.class=18;
                    set new.level=60;
                    set new.exp=0;
		end if;
		if new.class=9 and new.level=120 then 
                    set new.class=19;
                    set new.level=60;
                    set new.exp=0;
		end if;
		if new.class=10 and new.level=120 then 
	    set new.class=20;
                    set new.level=60;
                    set new.exp=0;
		end if;
		if new.class=11 and new.level=120 then 
	    set new.class=21;
                    set new.level=60;
                    set new.exp=0;
		end if;
		if new.class=12 and new.level=120 then 
	    set new.class=22;
                    set new.level=60;
                    set new.exp=0;
		end if;
		if new.class=13 and new.level=120 then 
	    set new.class=23;
                    set new.level=60;
                    set new.exp=0;
		end if;

		if new.class=16 and new.level=120 then 
		    set new.class=24;
                    end if;
		if new.class=17 and new.level=120 then 
		    set new.class=25;
       		end if;
		if new.class=18 and new.level=120 then 
		    set new.class=26;
          	end if;
		if new.class=19 and new.level=120 then 
		    set new.class=27;
                end if;
		if new.class=20 and new.level=120 then 
		    set new.class=28;
                end if;
		if new.class=21 and new.level=120 then 
		    set new.class=29;
              	end if;
		if new.class=22 and new.level=120 then 
		    set new.class=30;
		end if;
		if new.class=23 and new.level=120 then 
		    set new.class=31;
		end if;
		If New.Penya > 1 Then 
			Set New.Penya = 20000000;
		End If;
	end
 
Rebirth system mysql error...

killerdog, u have post a master-hero change job... but i need a rebirth system...
this is the original code:

Code:
CREATE TRIGGER rebirth before UPDATE ON characters
FOR EACH ROW

begin
		if new.class=16 and new.level=120 then 
		    set new.class=16;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=17 and new.level=120 then 
		    set new.class=17;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=18 and new.level=120 then 
		    set new.class=18;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=19 and new.level=120 then 
		    set new.class=19;
                    set new.level=60;
                    set new.rebirths  + 1;
		end if;
		if new.class=20 and new.level=120 then 
		    set new.class=20;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=21 and new.level=120 then 
		    set new.class=21;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=22 and new.level=120 then 
		    set new.class=22;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=23 and new.level=120 then 
		    set new.class=23;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
    end

i think the error is in the + ...
 
Re: Rebirth system mysql error...

killerdog, u have post a master-hero change job... but i need a rebirth system...
this is the original code:

Code:
CREATE TRIGGER rebirth before UPDATE ON characters
FOR EACH ROW

begin
		if new.class=16 and new.level=120 then 
		    set new.class=16;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=17 and new.level=120 then 
		    set new.class=17;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=18 and new.level=120 then 
		    set new.class=18;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=19 and new.level=120 then 
		    set new.class=19;
                    set new.level=60;
                    set new.rebirths  + 1;
		end if;
		if new.class=20 and new.level=120 then 
		    set new.class=20;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=21 and new.level=120 then 
		    set new.class=21;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=22 and new.level=120 then 
		    set new.class=22;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
		if new.class=23 and new.level=120 then 
		    set new.class=23;
                    set new.level=60;
                    set new.rebirths + 1;
		end if;
    end

i think the error is in the + ...

i know what i posted and eh yea xD
 
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+ 1;
end if;
if new.class=17 and new.level=120 then
set new.class=' at line 8

:blink::blink::blink:

I had the same problem,but I think I found away to fix it.

Code:
CREATE TRIGGER rebirth before UPDATE ON characters
FOR EACH ROW

begin
		if new.class=16 and new.level=120 then 
		    set new.class=16;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=17 and new.level=120 then 
		    set new.class=17;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=18 and new.level=120 then 
		    set new.class=18;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=19 and new.level=120 then 
		    set new.class=19;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=20 and new.level=120 then 
		    set new.class=20;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=21 and new.level=120 then 
		    set new.class=21;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=22 and new.level=120 then 
		    set new.class=22;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=23 and new.level=120 then 
		    set new.class=23;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
    end

Try this.
 
I had the same problem,but I think I found away to fix it.

Code:
CREATE TRIGGER rebirth before UPDATE ON characters
FOR EACH ROW

begin
		if new.class=16 and new.level=120 then 
		    set new.class=16;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=17 and new.level=120 then 
		    set new.class=17;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=18 and new.level=120 then 
		    set new.class=18;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=19 and new.level=120 then 
		    set new.class=19;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=20 and new.level=120 then 
		    set new.class=20;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=21 and new.level=120 then 
		    set new.class=21;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=22 and new.level=120 then 
		    set new.class=22;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
		if new.class=23 and new.level=120 then 
		    set new.class=23;
                    set new.level=60;
                    set new.rebirths =+ 1;
		end if;
    end

Try this.

This will work but just apparentelly, it will always make rebirths = 1, instead of '=+', it should be '+=' like I stated at the post before yours...
I didnt test it, but thinking logically thats how it works.
 
[Err] 1235 - This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
some people might get that *cough* me *cough*
 
[Err] 1235 - This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table' i get this can anyone help?
 
[Err] 1235 - This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
 
Back