Lathiat | they may be the same, but they may not i guess you could argue you could do it another way keep a history of all addresses in an addresses table |
majikman | spacefrog, IF is the keyword |
Lathiat | and when they change it, create a new address but still link to the old address from the invocies |
spacefrog | i suppose, but that would involve yet another table ive normalized almost everything else |
majikman | spacefrog, if a customer places 100 orders, thats a 100 copies of redundant data |
spacefrog | hmm yes. i'm not really sure if i should do this or not, but i guess it's one of those things that i might regret later |
majikman | and i'm assuming you want your business to be successful such that everyone places 100+ orders =) |
spacefrog | So an additional table for addresses, instead of the address in the clients table. |
majikman | umm... client_addr invoice_addr actually, you could just store them all in the same table |
spacefrog | no, clients, client_addr, invoice_addr. Client links to clients_addr for the current client address. |
majikman | why separate the addresses? well, there are reasons why but i'm betting you don't have any of those reasons |
spacefrog | i have a reason, which is what ive tried to explain. just a sec |
majikman | oh, ok sry |
spacefrog | The clients table have an AddressID which links to the Clients_addr table. When an order is processed, the DeliveryAddress becomes the current AddressID from the clients table. When the client changes their address, the AddressID changes to the new row in the Client_addr table. |
Lathiat | yeh thats what i said :) |
spacefrog | 3 tables not 2 :) probably best the changes are made now, before the site goes live. hehe |
majikman | i still don't see why you need 3 tables |
spacefrog | Because if the client changes their address, the addressID will change in the history of orders the old rows The 3rd table is the client him/herself |
majikman | eh? why would you change the addressid in the invoice history if the client changes his current address? |
nnnv | (Off Topic =]) Does anyone here use the gillette deodorant body spray? how is it? |
test34_ | it stinks, thats why I use it |
nnnv | it stinks? |
test34_ | yes |
nnnv | why do you want something that stinks then |