I'm hacking Expression Engine to enable the use of multiselect, radio and checkbox custom field types within the members profile form.
The model which parses the form and commits the update query submits all values from the form in one array variable - '$data'. One of the array values within $data is another array coming from a multiselect field type - so when the query is submitted it returns an error...
Unknown column 'Array' in 'field list'
UPDATE `apcims_member_data` SET `m_field_id_1` = '', `m_field_id_2` = Array WHERE `member_id` = '2'
So I need to implode any arrays within the $data array before the SQL is executed.
Is there a function something like...
foreach($data AS $value) {
if($value(is_array)) { $value = implode("|", $value); }
}
...then reinsert at the original index or position?
Any help appreciated.