CREATE DEFINER = 'root'@'%'
PROCEDURE db.admin_change_product(
IN infield varchar(255),
IN invalue varchar(255),
IN inidProduct int
)
BEGIN
UPDATE goods g SET g.infield = invalue WHERE g.id = inidProduct;
END
Unknown column 'g.inField' in 'field list'
UPDATE goods g SET `inField` = inValue WHERE `id` = inIdProduct;
SET @myquery := CONCAT("UPDATE goods SET ", infield, " = ", invalue, " WHERE id = ", inidProduct);
PREPARE myquery FROM @myquery;
EXECUTE myquery;
DEALLOCATE PREPARE myquery;