Saving Checkbox List

hello friends.

          In my form I have a attribute called type. that contain 1.theory 2.practical 3.tutorial.

these three options are in check box. I need to save it in to the db.

The problem is if the datatype for the "type" attribute is int means its saves as 1. If the datatype varchar means it saves as "Array". how can i save it. am in a bottleneck. plz help me out

this is my _form.php


<?php 

        $chk = CHtml::activeCheckBoxList($model,'type',CHtml::listData(Subjecttype::model()->findAll(), 'subjectType', 's_id'),

          array(

		  

            'separator'=>'',

            'template'=>'<div>{input}&nbsp;{label}</div>'

            )

        );  

		 

		echo $chk;

?>

what ill i do after this ???? thank you…

You can json_encode the array ‘type’ on beforeSave() and json_decode afterFind() of the model.