CodeIgniter Forums
active record foreign key... - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter Archived (from EllisLab) (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: active record foreign key... (/thread-48533.html)



active record foreign key... - El Forum - 01-20-2012

[eluser]psychoder[/eluser]
is there a way i can trap when the user delete the record which is
associated with another record in another table ( foreign key constraints )...


do i have to check it using another query??


active record foreign key... - El Forum - 01-20-2012

[eluser]Bhashkar Yadav[/eluser]
I think, you are deleting records from the controller's method.
so you can create a hook and associate as post_controller with the controller and method which deleting the records.
In this way you can track if records have been deleted successfully.


active record foreign key... - El Forum - 01-20-2012

[eluser]Bhashkar Yadav[/eluser]
for hooks, you can get help from here: http://ellislab.com/codeigniter/user-guide/general/hooks.html