Zen Cart Logo
Forums / General Questions / should I add new table to store new field?

should I add new table to store new field?

Views: 1,034

Results 1 to 5 of 5
21 Feb 2013, 6:45 AM
#1
linjuming avatar

linjuming

Zen Follower

Join Date:
Apr 2012
Posts:
151
Plugin Contributions:
0

should I add new table to store new field?

should I add new table to store new field in zencart db?

zencart original table
table : customers
customers_id | ...
1 | ...
2 | ...

now I need to add a new field for customer
I create a new table
table : customers_extra
customers_id | is_blogger
1 | 0
2 | 1

or directly created in the customers table
table: customers
customers_id | ... | is_blogger
1 | ... | 0
2 | ... | 1

which method should I use ? will add new table be worth to do ? will it slow down the query speed?

21 Feb 2013, 7:02 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: should I add new table to store new field?

What information are you going to store in this??

21 Feb 2013, 11:14 AM
#3
linjuming avatar

linjuming

Zen Follower

Join Date:
Apr 2012
Posts:
151
Plugin Contributions:
0

Re: should I add new table to store new field?

is_blogger means that if the customers is a fashion blogger or not.

21 Feb 2013, 12:00 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: should I add new table to store new field?

linjuming:

is_blogger means that if the customers is a fashion blogger or not.

And once the field is created, how are you going to load data to it and how are you going to use the data?

It's all very well having the field (that's the easy part)... How you get data into the field and how you use that data is what's complicated.

And is this data really necessary for the effective functioning of the store?

21 Feb 2013, 5:35 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: should I add new table to store new field?

You might be able to use the customer discount groups feature to store this info. (I am not sure if this would interfere with other uses of discount groups.) Create a "Blogger" discount group and add the appropriate customers to it. You don't have to actually discount anything here. You can then retrieve the info and use it wherever you want.