I am new to Yii , i have created an application in that form i have created an field as multi select option as shown below ......Can any one help me how to save the data into my mysql table for that what changes i have to do and where i have to change .. I want to save the each department which are selected have to be saved as rows
<?php
$data = array('101' => 'CSE', '102' => 'IT', '103' => 'EEE', '104' => 'ECE');
$selected = array(
'102' => array('selected' => 'selected'),
'103' => array('selected' => 'selected'),
);
$htmlOptions = array('size' => '5', 'prompt'=>'Use CTRL to Select Multiple Staff', 'multiple' => 'true', 'options' => $selected);
echo $form->listBox($model, 'department',$data, $htmlOptions, array('rows' => 6, 'cols' => 50, 'class' => 'text_area')); ?>
</div>