Page 1 of 1

Site & DB structure

Posted: Mon Jun 20, 2005 3:55 pm
by wizzard81
Hi,

I'm newbie in php and i'm currently working on my site.

Well i will some advertising options (paying) and trials free. I need some advice to setup my db structure.

I have this tables

customers
products
orders
orders_products
trials

My question is i don't want to let trials stored in my customers because they are only customers if they choose for paying advertising on my website.

Also another problem i maybe will have is when i run a second site on the same db and the same customers advertise on a second site and they want to change their info only for the second site then i don't know how i can fix this? Do i have to store the customers 2 times then so they can change like their address on one site and not on the other?

Posted: Mon Jun 20, 2005 4:06 pm
by pickle
You could just add a column in `customers` that sets which site the customer is for. You should have a column like that in all your tables. This, of course, means you should also have a `websites` table to map the website name to an id or a number.

You could make another table called `trial_customers` and just store trial customers in there.

Posted: Mon Jun 20, 2005 4:12 pm
by wizzard81
Thanks pickle for the advice.