In your controller try this code for saving image in folder and path in database
public function actionCreate()
{
$model=new Mastertable;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['Mastertable']))
{
$model->attributes=$_POST['Mastertable'];
$myfile=CUploadedFile::getInstance($model,'image_path');
if (is_object($myfile) && get_class($myfile)==='CUploadedFile') {
$model->image_path="path of folder to save image//{$myfile->name}";
}
if($model->save())
{
if (is_object($myfile))
$myfile->saveAs('path of folder'.$myfile->name);
$this->redirect(array('admin','id'=>$model->id));
}
}
$this->render('create',array(
'model'=>$model,
));
}
Repalce the Mastertable with your Modelname, and change the "path of folder" with path.