CodeIgniter Forums
Active Record: delete: specifying table to delete - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Active Record: delete: specifying table to delete (/showthread.php?tid=34576)



Active Record: delete: specifying table to delete - El Forum - 10-04-2010

[eluser]jepotski[/eluser]
Hi, how can i set the table to be deleted?

Code:
$this->db->select('test_entry.*'); // -- not working
            $this->db->where(array('tst_confirmatory' => 'te_confirmatory',"te_locked" => "0","te_id" => $resid),NULL,FALSE);
            $this->db->delete('test_entry left join testing on testing.tst_id = test_entry.te_testid');

it generates this:

Code:
DELETE FROM `test_entry` left join testing on testing.tst_id = test_entry.te_testid WHERE tst_confirmatory =te_confirmatory AND te_locked =0 AND te_id =451

and it is an error in mysql.

what i want to generate is this:

Code:
DELETE test_entry.* FROM `test_entry` left join testing on testing.tst_id = test_entry.te_testid WHERE tst_confirmatory =te_confirmatory AND te_locked =0 AND te_id =451