php - Updating a column of the db after inserting
I have a tablelotto_epins
with the following columns
lpin_id, lpin_serial, lpin_ec_id, lpin_epin, lpin_status
After inserting using PHP, I wish to update the columnlpin_serial
by adding 0 in front of thelpin_id
for a serial no.
I tried the following mysql trigger but it does not work.
CREATE TRIGGER `capital` BEFORE INSERT ON `lotto_epins`
FOR EACH ROW BEGIN
SET lpin_serial = LPAD(lpin_id,15,0)
END;
How can I correctly update the column after inserting?
Answer
Solution: