@Slax Rooth
because $rec_name does not exist, what exists is $rec_id and $modeldata['fieldname'], which is modeldata['id'], $modeldata['name'] and $modeldata['date'] for your works database table.
The following should be the correct thing in your Action After Add👇
$rec_name = modeldata['name'];
$db ->rawQuery ("CREATE TABLE `$rec_name`(
`id` INT(11) NOT NULL,
`name` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;");