Hello,
I've created the following in my model:
$tags = array('bike' => 'bike', 'breakdown' => 'breakdown', 'business' => 'business', 'car' => 'car', 'home' => 'home', 'other'
=> 'other', 'pet' => 'pet', 'travel' => 'travel', 'van' => 'van');
$fields['tags'] = array( 'type' => 'multi', 'mode' => 'multi', 'options' => $tags);
In my database I have a 'tags' column name, but firstly I don't know what Data Type the field should be?
When saving the record I get the following error:
Message: Array to string conversion
And further down the culprit:
Error Number: 1054
Unknown column 'Array' in 'field list'
INSERT IGNORE INTO `kbarticles` (`id`, `title`, `tags`, `slug`, `section1_heading`, `section1_content`, `section1_image`, `section2_heading`, `section2_content`, `section2_image`, `section3_heading`, `section3_content`, `section3_image`, `section4_heading`, `section4_content`, `section4_image`, `section5_heading`, `section5_content`, `section5_image`, `published`) VALUES ('3', 'What are the different types of Insurance cover?', Array, '/test', 'Explore the different types of coverage', '
Comments
if ( sizeof( $values['tags'] ) == 0 ) {
$values['tags'] = '';
}
return $values;
}