I understand that it’s a little rude to ask a question without any work to show, however I’m a little stumped and I need some help.
I need to delete a row from a mysql table if another field in another table is equal to 1
I have two tables table_1 and table_2
table_1 has two fields location and events
and table_2 has a field called location which is the same as location on table_1
I would like to delete one or more rows from table_2 if field location is the same as table_1 and events = 1
something like:
if `events` = 1 in `table_1` in 'location' `*`;
delete row(s) from `table_2`
where `location` is the same as `location` in `table_1`
1 Answer