I am new to programming and I have a problem when storing the values in an array using PDO.
I get a string from a form input:
$brands = "Nike, Adidas, Reebok";
I get an array where the string separated by commas:
$pieces = explode(",", $brands);
I need to store each value in the array in different records within a table using PDO, something like this:
$statement = " INSERT INTO userbrands (Name, Email, Brand) VALUES (:name, :email, :brand)";
$sth = $db ->prepare($statement);
$sth -> execute(array(':name'=>$name, ':email'=>$email, ':brand'=>$pieces));
Thanks for answering a rookie question!