[TYPO3-dev] Deleting record several places?
Franz Holzinger
franz at ttproducts.de
Mon Jan 5 11:02:11 CET 2009
Simon Justesen a écrit :
> I need to maintain two tables so that when I delete a record in
> list-view belonging to my extension it is also deleted in another table.
> How can I do that?
In MySQL 5.x you can create a trigger for deletion.
http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
http://all4dev.libre-entreprise.org/index.php/Utilisation_des_triggers#Cr.C3.A9ation_d.27un_trigger_ex.C3.A9cut.C3.A9_avant_une_suppression.
This should also work even if you delete a row with phpMyAdmin or any
another MySQL client application.
But normally TYPO3 records are not deleted, but the deleted field is set
to '1'.
Therefore you would need an UPDATE Trigger.
http://mysqldatabaseadministration.blogspot.com/2006/01/can-mysql-triggers-update-another.html
- Franz
More information about the TYPO3-dev
mailing list