Drop Down List Always Inserting 1 In Db

Here department is my table it contains only two fields id and department. My model name is also department.

This is my form

<?php echo $form->labelEx($model, ‘department’); ?>

    &lt;select name=&quot;department&quot;&gt;


        &lt;option value=&quot;select&quot;&gt;select&lt;/option&gt;


       &lt;?php for(&#036;i=1;&#036;i&lt;30;&#036;i++) {?&gt;

<option value="<?php echo $i; ?>"><?php echo $i; ?></option>

<?Php } ?>

</select>

While I clicking create button the value is inserted in the database is always one if I select any number the value is inserted is 1 can you help me please .

Thanks in advance .


<?php $data = array_combine(range(1, 29), range(1, 29)); ?>

<?php echo $form->dropDownList($model, 'department', $data, array('empty' => 'select')); ?>