Q:

MYSQL trigger error on insert with NEW keyword in CONCAT function

I have an issue in mysql trigger insert:
CREATE TRIGGER `trg1` AFTER INSERT ON `table1` FOR EACH ROW 

BEGIN
      SET @column = (SELECT GROUP_CONCAT(table_1.col1 SEPARATOR ',')   FROM table2,table3..etc;
      SET @values = (SELECT GROUP_CONCAT(CONCAT_WS('.','NEW', table_1.col1) SEPARATOR ',') FROM table2,table3..etc);
      INSERT INTO log_table(Description)VALUES(CONCAT(@values));
END;
    $$ 
    DELIMITER ;

I am selecting the column names and concatenating it with NEW keyword and then inserting the values in the log table as a single string.
But the values gets stored in string format as 'NEW.col1,NEW.col2..etc' without the values of NEW keyword.PLs help me out..
table structure

A:

Within the trigger body, the OLD and NEW keywords enable you to access  columns in the rows affected by a trigger
In an INSERT trigger, only NEW.col_name can be used.

SET @values = (SELECT GROUP_CONCAT(CONCAT_WS('.',table1.col1,NEW.col1,NEW.col2,NEW.col3) SEPARATOR ',') FROM table2,table3..etc);

You used NEW inside ''(quotes).Remove it. and use NEW.col1.
Hope this helps.

