Welcome Guest, Not a member yet? Register   Sign In
(n00b) My first lookup table !
#1

[eluser]Samuurai[/eluser]
Hi everyone,

Thanks for looking at my post. I'm trying to do a lookup table properly, with constraints and everything and am a little fuzzy on how I'm supposed to proceed.

I have three tables,

device(id, name)
outage(id, date, time)
device_outage(device_id, outage_id)

(please note, an outage can have many devices and a device can have many outages)

My first question is, do I need any foreign key constraints on this relationship. Also, is this called a many to many relationship?

Then when it comes to working with my CI Model, how can I get it to insert the data correctly? db->insert seems to only accept an argument for one table at a time, do I need to perform many queries to insert the data?

Thank you!


Messages In This Thread
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 05:18 AM
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 05:29 AM
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 05:31 AM
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 07:14 AM
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 07:15 AM
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 07:21 AM
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 07:31 AM
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 08:25 AM
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 09:39 AM
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 10:08 AM
(n00b) My first lookup table ! - by El Forum - 07-07-2009, 10:11 AM
(n00b) My first lookup table ! - by El Forum - 07-27-2009, 07:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB