I have this:
This is on chars_insert, before.
BEGIN
IF EXISTS (SELECT * FROM chars WHERE accid = NEW.accid)
BEGIN
INSERT INTO `char_vars` SET `charid = NEW.charid, `varname` = `NotFirstChar`, `value` = 1;
END
INSERT INTO `char_equip` SET `charid` = NEW.charid;
INSERT INTO `char_exp` SET `charid` = NEW.charid;
INSERT INTO `char_jobs` SET `charid` = NEW.charid;
INSERT INTO `char_pet` SET `charid` = NEW.charid;
INSERT INTO `char_points` SET `charid` = NEW.charid;
INSERT INTO `char_profile` SET `charid` = NEW.charid;
INSERT INTO `char_storage` SET `charid` = NEW.charid;
INSERT INTO `char_inventory` SET `charid` = NEW.charid;
END
I had just added the IF EXISTS part...which broke the trigger. I am trying to find if one accountid has a character already and if they do, add a variable to the created character saying that this is not their first one. It says the error is on the IF EXISTS line, but I see no error...help please?