you can try this. but it will not work because. codeigniter ignore merge when deleting active records.
$this->db->join("table2", "table1.thing_id = table2.id")
->where("table2.otherthing_id", $id)
->delete("table1");
you can use the following code to delete data from different tables. This will help you.
$sql = "DELETE t1 FROM table1 t1
JOIN table2 t2 ON t1.thing_id = t2.id
WHERE t2.otherthing_id = ?";
$this->db->query($sql, array($id));
source
share