I have an array of values, and one of the values is another array (see below). I implode the inner-array so that it becomes v0,v1,vx and I’m inserting it into a column of a mysql database where the datatype is SET()
a = array(
"first"=>"foo",
"second"=>array("b","a","r"), // this becomes "second"=>"b,a,r",
"third"=>"bang"
)
My question is which PDO::PARAM_* should I use?
(Initially I would think PARAM_STR, but I’m not sure if PDO will do something that won’t work with SET()).
PARAM_STRshould do the job correctly. It will escape values and add single quotes around comma separated list.