when I delete a record, which has a relationship, I want to take a message telling me that I can not remove
anyone know how to do
when I delete a record, which has a relationship ?
Started by Lucas, Jul 11 2012 01:13 AM
relation n_n delete
2 replies to this topic
#1
Posted 11 July 2012 - 01:13 AM
#2
Posted 11 July 2012 - 05:38 AM
#3
Posted 11 July 2012 - 05:15 PM
Either use a callback_before_delete function as suggested by noskov or you can cascade delete the records if you are absolutely sure you won't need them.
For example you have a table of clients and a table of phone numbers related to clients. Whenever you delete a client you want to delete all phone numbers of that particular client. If this is your case then use cascade delete on your mysql, considering you are using InnoDB.
If you don't know how to use the on delete cascade, then check this post at stackoverflow:
http://stackoverflow...ascade-in-mysql
Hope this helps
For example you have a table of clients and a table of phone numbers related to clients. Whenever you delete a client you want to delete all phone numbers of that particular client. If this is your case then use cascade delete on your mysql, considering you are using InnoDB.
If you don't know how to use the on delete cascade, then check this post at stackoverflow:
http://stackoverflow...ascade-in-mysql
Hope this helps
Also tagged with one or more of these keywords: relation n_n, delete
Support →
I have a question →
Is there any callback available when deleting an uploaded file (not 1 row data)?Started by SilentSeth, 06 Apr 2013 |
|
|
||
Support →
I have a question →
set_upload_field can't delete filesStarted by yourself, 18 Mar 2013 |
|
|
||
Support →
I have a question →
Hide "edit" and/or "delete" in some rows, depending of result of a queryStarted by jorocoimbra, 14 Mar 2013 |
|
|
||
Support →
I have a question →
Checkboxes against each row for bulk delete optionStarted by Mrinal Rajpurohit, 10 Feb 2013 |
|
|
||
Support →
I have a question →
Delete row/rows after X time ?Started by tlc033, 20 Dec 2012 |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












