Welcome Guest, Not a member yet? Register   Sign In
Active Record: delete: specifying table to delete
#1

[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




Theme © iAndrew 2016 - Forum software by © MyBB