what i'm want is:
insert new photo with the pased $artid
and the name of article shown in the add field form
this is the code after update
$crud = new grocery_CRUD();
$crud->set_subject(lang('more_photos'));
$crud->set_table('art_pic');
$crud->set_relation('art_id','article','Name');
$crud->where("art_id = $artid");
$crud->columns('art_id','name','img_url');
$crud->display_as('art_id',lang('art_id'))
->display_as('name',lang('photo_name'))
->display_as('img_url',lang('img_url'));
$crud->set_language(lang('lang'));
$crud->fields('art_id','name','img_url');
$crud->change_field_type('art_id','hidden',$artid);
$crud->set_field_upload('img_url', 'assets/uploads/');
//---------->>>>call back functions
$crud->callback_add_field('art_id',array($this,'add_field_callback_1'));
$crud->callback_edit_field('art_id',array($this,'edit_field_callback_1'));
$output = $crud->render();
$this->_output_data($output);
}
function add_field_callback_1()
{
$query= $this->admin_model->Article_name($this->uri->segment(4));
return $query['Name'];
}
it shown the article name but photo stored in data base with art_id=0
when i stopped the call back the photo inserted correctly but the name of article doesn't appeared in add form
please help?