Create Trigger in phpMyAdmin
DROP TRIGGER IF EXISTS testTrigger;
CREATE TRIGGER testTrigger
BEFORE INSERT ON tbl_table1
FOR EACH ROW
BEGIN
INSERT INTO tbl_table2 VALUES (NEW.id,NEW.name);
END;
Create Trigger in phpMyAdmin
DROP TRIGGER IF EXISTS testTrigger;
CREATE TRIGGER testTrigger
BEFORE INSERT ON tbl_table1
FOR EACH ROW
BEGIN
INSERT INTO tbl_table2 VALUES (NEW.id,NEW.name);
END;
Create Trigger in phpMyAdmin
CREATE TRIGGER `before_delete` BEFORE DELETE ON `barcode_master`
FOR EACH ROW BEGIN
UPDATE library_emp_master SET job_type = 1 WHERE barcode_no = OLD.barcode_no;
END;
how to make trigger in phpmyadmin
ALTER TABLE sales_details
ADD FOREIGN KEY fk_product_code(product_code)
REFERENCES products(product_code)
ON DELETE CASCADE;
Create Trigger in phpMyAdmin
DELIMITER &&
CREATE OR REPLACE TRIGGER tr_ajoutHotelResponsable
BEFORE INSERT ON cpoa.hotels
FOR EACH ROW
BEGIN
IF(
EXISTS(
SELECT *
FROM cpao.responsables
WHERE numResponsable = NEW.numResponsable
)
)
THEN
UPDATE cpoa.responsables
SET nbHotel = nbHotel + 1
WHERE numResponsable = NEW.numResponsable;
ELSE
INSERT INTO cpao.responsables ( nom, prenom, nbHotels )
VALUES ( 'nouveau', 'nouveau', 1 );
SET NEW.numResponsable = LAST_INSERT_ID();
END IF;
END&&
DELIMITER ;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us