Zdravim, neviem ho rozbehat a to idem presne podla
http://www.mysqltutorial.org/create-the ... mysql.aspxkde moze byt hacik ?
napise mi>
Citácia:
#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 'DELIMITER $$
CREATE TRIGGER before_employee_update
BEFORE UPDATE ON employ' at line 1
presne z toho webu si ztiahnem testovaciu DB:
http://www.mysqltutorial.org/download/2a potom pouzijem tieto prikazy, tiezpriamo z webu skopirovane:
Kód:
CREATE TABLE employees_audit (
id int(11) NOT NULL AUTO_INCREMENT,
employeeNumber int(11) NOT NULL,
lastname varchar(50) NOT NULL,
changedon datetime DEFAULT NULL,
action varchar(50) DEFAULT NULL,
PRIMARY KEY (id)
)
a tento prikaz uz neprejde:
Kód:
DELIMITER $$
CREATE TRIGGER before_employee_update
BEFORE UPDATE ON employees
FOR EACH ROW BEGIN
INSERT INTO employees_audit
SET action = 'update',
employeeNumber = OLD.employeeNumber,
lastname = OLD.lastname,
changedon = NOW();
END$$
DELIMITER ;
klasicky cez PhP My admin idem, skusal som aj cez mySQL Workbench, ta ista chyba