I tried to look for the shortest way to delete 2 entries in database.
This entries are in touch which a third tables (marked as "c" in the following code) this one is a reference table and should not delete.
I tried do to this, but it failed. Did i have a simple syntax-bug or is it not possible in codeigniter or have i do this in another way?
$this->db->where(" (a.refid='".$this->session->ud('id')."' and b.refid='".$this->session->ud('id')."') and c.type='".$tempid."' and c.templateid=a.templateid and c.slug=b.slug");
$this->db->delete('a.*,b.*');
$this->db->from('table_a a, table_b b, table_c c');
$delinfo=$this->db->affected_rows();
I want to delete in:
table a - the row which has "refid" and is in touch with table c by "type"
table b - the row which has "refid" and is in touch with table c by "slug"
table c - nothing to delete