Sunday, September 11, 2011

PHP DATABASE

 
Database : `products`
There are three tables in this ie
1.category
2.subcategory
3 subcategory2
 
 
 
Table structure for table `category`
#
 
 
CREATE TABLE category (
  cat_id int(2) NOT NULL auto_increment,
  category varchar(25) NOT NULL default '',
  PRIMARY KEY  (cat_id)
) TYPE=MyISAM;
 
#
# Dumping data for table `category`
#
 
INSERT INTO category VALUES (1, 'fruits');
INSERT INTO category VALUES (2, 'colors');

# --------------------------------------------------------

Table structure for table `subcategory`
#
 
CREATE TABLE subcategory (
  cat_id int(2) NOT NULL default '0',
  subcategory varchar(25) NOT NULL default '',
  subcat_id int(2) NOT NULL default '0'
) TYPE=MyISAM;
 
#
# Dumping data for table `subcategory`
#
 
INSERT INTO subcategory VALUES (1, 'banana', 10);
INSERT INTO subcategory VALUES (1, 'apple', 20);
INSERT INTO subcategory VALUES (2, 'red', 0);
INSERT INTO subcategory VALUES (2, 'green', 0);
 
# --------------------------------------------------------
 
 
 
 
# Table structure for table `subcategory2`
#
 
CREATE TABLE subcategory2 (
  subcat_id int(2) NOT NULL default '0',
  subcat2 varchar(25) NOT NULL default ''
) TYPE=MyISAM;
 
#
# Dumping data for table `subcategory2`
#
 
INSERT INTO subcategory2 VALUES (20, 'apple hot');
INSERT INTO subcategory2 VALUES (20, 'apple sweet');
 

No comments:

Post a Comment

Type Your Comments........