One table or many in shop database

  HighTower 13:07 19 Sep 2006
Locked

I'm going to be creating an ecommerce site soon, database driven, php mySQL, with potentially a couple of hundred members.

Do I create one big table with all the members items in, or do I create a table per member? Each member will sell between 10 - 60 items.

If I create a table per member how will this affect a database search facility? I imagine it would be easier to create a search that queries one main table rather than many? Or will one big table be slower to search?

Thanks

  harristweed 08:40 20 Sep 2006

Without being unkind, the fact that you are asking this question shows you don't have suffient knowledge of relational databases to design a complex ecommerce site.

However, as a minimum, you have one table for articles for sale, one table for vendors, one table for customers, one table for ‘the shopping cart’ and one for the transactions.

A good tutorial is:
click here

  ade.h 13:45 20 Sep 2006

If I were you, I would consider an off the shelf e-commerce package that you can integrate into your site.

  HighTower 09:16 21 Sep 2006

Thanks for your comments.

I use WebAssists eCart software which I find pretty useful and easy to integrate. I've written shops before where there has been only one store, and have used relational databases to some extent, basically in the way outlined in harristweed's post. However there has only been one "owner", ie, that of the store itself.

In this case I have several owners and want to be sure that I can ensure privacy. Having one big table and giving each member limited access to edit or add products under their own "member_ID" field only is one solution, but I was worried that by simply changing a php query in the web browser from "store.php?ID=1234" to "store.php?ID=1235" the user could potentially edit someone elses details maliciously.

I figured that perhaps giving each member their own table may help combat this, but this may complicate the search facility.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5 review

See the work of famous artists playing with toys

iPad Pro 10.5in (2017) review

Comment faire une capture d’écran sur un Mac ?