load image from database

I want see image from database ,but I have erro, I only see name of image , Do you can help me?


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

	'data'=>$model,

	'attributes'=>array(

		'idPhone',

		'idNSX',

		'Price',

		'Date',

		'Images',

	),

)); ?>

Does your table saves the data in a blob field? whats your controller action to show the data? also please make a search in the forum, this question has been answered several times.

sorry , I searched in the fourum but there is not right in my case ,

my case is:

in file _view : I used code :


<?php  echo CHtml::link( CHtml::image(Yii::app()->request->baseUrl."/images/".$data->HinhAnh,$data->HinhAnh,array('width'=>150,'height'=>190)), array('view', 'id'=>$data->MaDT));  ?>

in file view : only code


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

	'data'=>$model,

	'attributes'=>array(

		'MaDT',

		'MaHangSX',

		'Gia',

		'NgayNhap',

		'HinhAnh',

		

		

		)

		

	),

)); ?>



so I do not know how write code in file view ,you help me , thanks

You didn’t answer any of my questions, how am I suppose to help you?

The following wiki page should solve your problem

Saving files to a blob field in the database