I want to know how can I add more than one auto increment in the same table. Usually I use sequence for this issue but in myphpadmin, I don't have sequence so I have do it in other way.
Below is the example I'm trying to achieve. which is have ID, SecondID and thirdID all auto increment. I cant change the structure to have only one auto increment due to many issues so i need to follow this structure
CREATE TABLE test (
ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
section VARCHAR(300) NOT NULL,
secondID INT AUTO_INCREMENT,
thirdID INT AUTO_INCREMENT,
message VARCHAR(1000) NOT NULL
);
CREATE TRIGGER testing After INSERT
ON test
FOR EACH ROW
INSERT INTO test(secondID) VALUES(LAST_INSERT_ID());
END;
I tried using the Trigger but im getting error saying
"#1442 - Can't update table 'test' in stored function/trigger because it is already used by statement which invoked this stored function/trigger. "
Can anyone provide me with suggestion or approach to solve this issue
Thank you