⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

callback_insert not working



Allan Alvarez Ortiz
  • profile picture
  • Member

Posted 27 July 2015 - 23:32 PM

Hi i'm having a problem with grocery crud, i want to use the callback_insert to create some rules on the insert but its not working not even by doing nothing i mean setting the callback_insert like this:
 

$crud->callback_insert(array($this,'insert'));

and the funtion like this:

function insert($post_array) {
      return $this->db->insert('archivo',$post_array);
}

it keep giving me in google chrome console:
 

POST http://localhost/agenda/index.php/backend/archivo/insert 500 (Internal Server Error)

Paul Savostin
  • profile picture
  • Member

Posted 28 July 2015 - 12:39 PM

Hi! In order to add some rules like validation you can use ->set_rules with custom callback function
 

For help it better write here

1) all code function and callback function code

2) Maybe database shema of table


3) Maybe write what logic u want implement before insert

 

 

Then I could help you!