Jump to content

Linking my tables....


romio

Recommended Posts

well am a bit confused, my database should include many categories and each category could have one or more product, i have designed both of my tables, but how will i proceed now, how do i join them....

[code]

CREATE TABLE categories
(
              
                 categoryID int(11) NOT NULL auto_increment RIMARY KEY,  
                 name varchar(255) default NULL,              
                 parent int(11) default NULL,                
                 products_count int(11) default NULL,        
                 description text,                            
                 picture varchar(30) default NULL,            
                 products_count_admin int(11) default NULL
);
[/code]
[code]
CREATE TABLE products
(                      
               productID int(11) NOT NULL auto_increment PRIMARY KEY,    
               categoryID int(11) default NULL,              
               name varchar(255) default NULL,              
               description text,                            
               customers_rating float NOT NULL default '0',  
               Price float default NULL,                    
               picture varchar(30) default NULL,            
               in_stock int(11) default NULL,                
               thumbnail varchar(30) default NULL,
               items_sold int(11) NOT NULL default '0',      
               big_picture varchar(30) default NULL,        
               enabled int(11) NOT NULL default '0',        
               brief_description text,                      
               list_price float default NULL,                
               product_code varchar(25) default NULL                    
);
[/code]
Link to comment
Share on other sites

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.