image from database

in view

    <?php echo CHtml::encode($model->getAttributeLabel('image')); ?>:

    <?php echo CHtml::image($model->image); ?>

in controller:

public function actionProfile()


            $blogger_id     =   3;

            $model          =    Blogger::model()->find(array('condition'=>"id='$blogger_id'"));



i save image in blob in database but it not showing the image .Plz help me.

i also use

<?php $this->widget('zii.widgets.CDetailView', array(








)); ?>

but it shows the some codes not image how should in convert that code into image

Try like this -

I think you also need to specify the directory path, where your image is located.

eg. -


If its stored as a blob, I think you have to set the appropriate content type for it to display. See this link: