I have two related tables to create a grid.
When I delete a record in the grid, only the record of one of the tables is deleted.
How to also delete the related record in the other table?
Thanks for your help.
This is the relationship
$g->select_command = "SELECT * FROM ( SELECT
LEFT(CONCAT(r.nombre, ' ', r.apellidos),20) as nombre_t,
SUBSTRING($campo_semana,2,21) as semana,
if((r.regimen = 0 OR r.regimen =''),'', r.regimen) AS regimen_final,
FROM residentes r
INNER JOIN comidas c
ON c.sala_comida = r.sala
I delete the record of the "residents" table, but not delete the corresponding record in the table "comidas"
You need to use on_delete event handler and write delete query code in callback function.
How useful was this discussion?
Click on a star to rate it!
Average rating / 5. Vote count:
We are sorry that this post was not useful for you!
Let us improve this post!
Thanks for your feedback!