I am currently working in a Evaluation system. I have a problem about the comment feature. The input field is dynamically created on how many personnel you will rate. I have an error when it comes in inserting an array of comment into may database and its type is text and in my database is varchar. when Im inserting my comment to database it is empty.
I already check if its under my form and I already check the name that I post and its all correct.
my input field
<input type="text" class="form-control" name="nComment[]">
php code who process
foreach($_POST['nPersonnelId'] as $i => $personnelId ){
$rComment = $_POST['nComment'][$i];
mysqli_query($conn,"INSERT INTO comment
(personnelId,comment)
VALUES ('$personnelId','$rComment')");
}