I create a trigger in phpmyadmin for deletion, but I get an error # 1064 I can not understand what is wrong?

DELIMITER // CREATE TRIGGER `delete_klient` BEFORE DELETE ON `klienti` FOR EACH ROW BEGIN DELETE FROM `zakazi` WHERE `id_klient`=OLD.`id`; END 
  • Give the text of the error. - RAMe0

1 answer 1

Try without BEGIN and END:

 CREATE TRIGGER `delete_klient` BEFORE DELETE ON `klienti` FOR EACH ROW DELETE from `zakazi` WHERE `id_klient`= OLD.`id` 

Also, make sure the table names match, they are case sensitive.

In general, without the error message itself, it is difficult to say what the problem is.