I new to GC and I found it very easy to use and to learn
the documentation and the forum help me alot and thanks to any one have a hand in this
I have a situation , I want to add data to another table after submit the form so I use :
callback_after_insert
and add a fake filed I called it [color=#ff0000]whem[/color]
like this :
....
$crud = new grocery_CRUD();
$crud->set_table('customers');
$crud->set_subject("customers");
$crud->add_fields('C_full_name','whem','C_email','C_mobile');
$crud->callback_after_insert('whem',array($this,add_whem));
$output = $crud->render();
.....
public function add_whem($post_array,$primary_key)
{
$whem_data = array(
"CF_C_id" => $primary_key,
"CF_name" => $post_array['whem']
);
$this->db->insert('customers_followers',$whem_data);
return true;
}
the filed appears in the form , but after submit nothing happen , and I found the error from firebug in the URL
http://localhost/APP/index.php/admin/customers/index/insert
with this error :
Error Number: 1054
Unknown column 'whem' in 'field list'
INSERT INTO `customers` (`C_full_name`, `whem`, `C_email`, `C_mobile`)
Filename: DB_driver.php
Line Number: 330
its should not use the fake field [color=#ff0000]whem [/color]in the insert ! and I dont know why ?
I hope found the help
thank you ..