⚠ 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

saving additional data



amipax
  • profile picture
  • Member

Posted 08 October 2012 - 21:59 PM

hi,

I just don't know how to save additional fields data that don't need a form input .

example:

I have a function to save created_at and updated_at dates, how do i call it then insert it on db?

i tried this with no success :

$crud->field_type('created_at','invisible',date('Y-m-d H:i:s'));


how do i save $_SESSION['user_id'] or any $_SESSION variable??

thanks in advance

victor
  • profile picture
  • Member

Posted 09 October 2012 - 17:11 PM

HI! You can use a callback function.
http://www.grocerycrud.com/documentation/options_functions/callback_before_insert
http://www.grocerycrud.com/documentation/options_functions/callback_before_update

amipax
  • profile picture
  • Member

Posted 09 October 2012 - 19:07 PM

Thanks a lot.