how to use a variable as a part of a field name in mysql trigger declaration
Your syntax is wrong. I don't think putting a loop inside a TRIGGER is a good idea, but I made you a Stored Procedure as example:

Procedure:

USE `test`;
DROP procedure IF EXISTS `new_procedure`;

DELIMITER $$
USE `test`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `new_procedure`()
BEGIN

SET @counter=0;
SET @column='';

WHILE (@counter &lt; 6) DO
    SET @counter=@counter+1;
    set @column = CONCAT("num",@counter); /*will be num1 num2, so on*/
    SELECT CONCAT(" SET @number = NEW.",@column,"; ");

END WHILE;
END$$

DELIMITER ;


Output Test: 

mysql&gt; call test.new_procedure();
+--------------------------------------------+
| CONCAT(" SET @number = NEW.",@column,"; ") |
+--------------------------------------------+
|  SET @number = NEW.num1;                   |
+--------------------------------------------+
1 row in set (0.00 sec)

+--------------------------------------------+
| CONCAT(" SET @number = NEW.",@column,"; ") |
+--------------------------------------------+
|  SET @number = NEW.num2;                   |
+--------------------------------------------+
1 row in set (0.00 sec)

+--------------------------------------------+
| CONCAT(" SET @number = NEW.",@column,"; ") |
+--------------------------------------------+
|  SET @number = NEW.num3;                   |
+--------------------------------------------+
1 row in set (0.00 sec)

+--------------------------------------------+
| CONCAT(" SET @number = NEW.",@column,"; ") |
+--------------------------------------------+
|  SET @number = NEW.num4;                   |
+--------------------------------------------+
1 row in set (0.00 sec)

+--------------------------------------------+
| CONCAT(" SET @number = NEW.",@column,"; ") |
+--------------------------------------------+
|  SET @number = NEW.num5;                   |
+--------------------------------------------+
1 row in set (0.00 sec)

+--------------------------------------------+
| CONCAT(" SET @number = NEW.",@column,"; ") |
+--------------------------------------------+
|  SET @number = NEW.num6;                   |
+--------------------------------------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql&gt;