anyone knows how i get the value inserted in an after callback? i need to put it into a variable
thanks in advice
⚠ 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. ⚠
Posted 27 May 2013 - 22:04 PM
anyone knows how i get the value inserted in an after callback? i need to put it into a variable
thanks in advice
Posted 28 May 2013 - 05:22 AM
Explain what you want. Show your code
Posted 28 May 2013 - 15:48 PM
i want to retrieve the values of a many to many relationship so i can then insert them on a second table
Posted 29 May 2013 - 04:54 AM
Well you can attain this functionality by writing it out in callback_after_insert
there you will get the row object and rowid (the last insert id)
with the last insert id, you can connect to the relation_n_n table and retrive rows for the same. You will get all the ids of other table that are been selected.
Welll thats it, then apply the logic of yours to store them into the second table of yours.
Posted 29 May 2013 - 05:03 AM
Callbacks are the best way to manipulate data at any stage of your application. So try to use them as much as you can.