Saving more than one value to same column in MySQL via PHP

I want to get data from CF7 checkboxes and then save them to the same column in the MySQL database.

For example form is like that:

First and Last name: First Last

What do you like:

X cars, X bikes, X planes

Where did you hear about us? (Dropdown) FB IG Google

  • X is checked box.

Script I use for saving values excluding the multiple checkbox:

$firstLastName = $data["first-last"];
$marketing_source = $data["marketing_source"];



$mydb->insert(
   'TableName',
    array(
        'firstLastName' => $firstLastName,
        'marketing_source' => $marketing_source[0],
    ),
    array(
          '%s','%s',
    )
);

So I want to add a line that will also save multiple selections when user selects more fields in checkbox.

Answer

Solution:

'like' => $like[0].", ".$like[1].", ".$like[2].", ".$like[3],

this code when you want to put values to MySQL db.

Source