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


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








		echo $chk;


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

Why you dont use this :

	<div class="row">

		<?php echo $form->labelEx($model,'theory '); ?>

		<?php echo  $form->checkBox($model,'user_type',array('value'=>'theory ','size'=>10,'maxlength'=>10)); ?>

		<?php echo $form->error($model,'user_type'); ?>


	<div class="row">

		<?php echo $form->labelEx($model,'practical '); ?>

		<?php echo $form->checkBox($model,'user_type',array('value'=>'practical ','size'=>10,'maxlength'=>10)); ?>

		<?php echo $form->error($model,'user_type'); ?>


	<div class="row">

		<?php echo $form->labelEx($model,'tutorial'); ?>

		<?php echo $form->checkBox($model,'user_type',array('value'=>'tutorial','size'=>10,'maxlength'=>10)); ?>

		<?php echo $form->error($model,'user_type'); ?>


Thank you for you response

As am using this, If am selected the theory and the practical means in my db this will not saved as "theory,practical" in the type column. I need to save like this


try to use this example