使用PHP将表单数组添加到MySQL

I cannot get the array put into the MySQL database in the format 'arrayitem1,arrayitem2,etc...'

Here's where my forms are:

<form action="http://www.nccskills.co.uk/bookings/process.php" method="post" name="bookingForm">
  <div id="row12">
    <div class="col1">
      <input type="checkbox" name="vocCheck[]" value="HASA">
      &nbsp;&nbsp;HEALTH AND SAFETY AWARENESS
    </div>
    <div class="col2">
      <input type="checkbox" name="vocCheck[]" value="EAD">
      &nbsp;&nbsp;EQUALITY AND DIVERSITY
    </div>
  </div>
  <div id="row13">
    <div class="col1">
      <input type="checkbox" name="vocCheck[]" value="ECC">
      &nbsp;&nbsp;EFFECTIVE CUSTOMER CARE
    </div>
    <div class="col2">
      <input type="checkbox" name="vocCheck[]" value="CC">
      &nbsp;&nbsp;CARE CERTIFICATE</div>
    </div>

What php would I use to achieve this?

Thanks in advance.

In your process.php file you would want to have code that looks somewhat like this:

//Create a connection using MySQLi
$conn = new mysqli($servername, $username, $password, $dbname);

//Prepare a statement.
$conn->prepare('INSERT INTO tablename(fieldname) VALUES(?)');

//Put all the checkboxes together, if anything is selected.
$checked = '';
if(is_array($_POST['vocCheck'])) {
    $checked = implode(',', $_POST['vocCheck']);
}

//Bind the value.
$conn->bind_param('s', $checked);

//Execute the question.
$conn->execute();

Not 100% sure you actually need to check if $_POST['vocCheck'] is an array and I cant try right now so I included it just to be on the safe side. You might want to throw some error handling into that in case the connection doesn't work etc. Some useful links for you: