Jump to content

Recommended Posts

Hi ppl,

 

I am developing a Shopping Site.

 

And these are the Tables I have. Are the fields OK? Inputs appreciated.  ;)

 

customer

 

Field      Type            Null Default Links to Comments MIME

custid    int(4)           No    

name     varchar(50)   No    

address  text             No    

postcode  varchar(9)   No    

phone       int(11)        Yes NULL    

email         varchar(50) No    

username  char(10)     No    

password  char(10)     No    

 

order

 

Field          Type        Null Default Links to Comments MIME

ordernum    int(4)      No    

custid        int(10)     No    

productid   int(10)      No    

quantity    int(2)        No    

orderdate  date          No    

totalpaid  decimal(6,0)  No    

orderstatus                       set('ALLOCATED', 'DISPATCHED', 'CANCELLED') No ALLOCATED    

 

product

 

Field          Type              Null Default Links to Comments MIME

productid    int(4)             No    

name          varchar(50)    No    

stock level  int(2)             Yes NULL    

price          decimal(6,0)   No    

rating          int(1)           Yes NULL    

reviews        text             Yes NULL    

 

Link to comment
https://forums.phpfreaks.com/topic/45477-are-the-tables-ok-for-this-database/
Share on other sites

I don't know the scope of your project but customer info should not be stored with login. Have a login table and have another table for customer info.

 

Order will comprise of multiple products which mean same order number for different product Id's.

 

I suggest lookup all conceptual Database design books. On another note I will also suggest not making a brand new shopping cart. Look up oscommerce.com or zen cart. You have already built in shopping carts for free. Use it and modify what you don't need.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.