I would like to store 3 input fields in 1 mysql database field, named 'date'. In stead of storing a date in the yyyy-mm-dd format, it only stores the word 'array'... Can anybody help?
View
Controller
View
<? echo CHtml::activeDropDownList($page, 'date[day]', CHtml::listData($day, 'id', 'name')); ?> <? echo CHtml::activeDropDownList($page, 'date[month]', CHtml::listData($month, 'id', 'name')); ?> <? echo CHtml::activeDropDownList($page, 'date[year]', CHtml::listData($year, 'id', 'name')); ?>
Controller
public function actionPage()
{
$page = new Page;
if(isset($_POST['Page']))
{
$page->birthdate = implode("-", $_POST['Page']['date']);
$page->attributes = $_POST['Page'];
$page->save();
}
}