Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Deleting data from two tables simultaneously
#8

[eluser]Unknown[/eluser]
[quote author="theshiftexchange" date="1295943163"]Ok - I've worked it out using a normal SQL query. I tried to convert it to an active record query but it doesnt work for some reason.

function delete_id ($my_ID_to_delete)
{
return $this->db->query("
DELETE t1.*, t2.*
FROM table1 t1, table2 t2
ON t1.id = t2.id
WHERE t1.id = '".$my_ID_to_delete."'");
}[/quote]


Messages In This Thread
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 01-21-2011, 12:14 AM
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 01-21-2011, 08:05 AM
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 01-22-2011, 06:29 PM
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 01-24-2011, 08:14 AM
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 01-24-2011, 08:12 PM
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 01-25-2011, 07:04 AM
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 01-25-2011, 10:08 AM
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 02-17-2011, 06:13 AM
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 03-14-2012, 02:59 AM
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 03-14-2012, 03:37 AM
[SOLVED] Deleting data from two tables simultaneously - by El Forum - 06-05-2013, 07:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB