Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/02/2010, 09:13
luxo
 
Fecha de Ingreso: enero-2007
Mensajes: 35
Antigüedad: 17 años, 3 meses
Puntos: 2
Respuesta: DB Categorias / Subcategorias de Productos.

Perdon cometi un error las tablas serian de la siguiente forma


CREATE TABLE `categoria` (
`id_cat` int(11) NOT NULL auto_increment,
`cat_nombre` varchar(50) NOT NULL,
`cat_descripcion` longtext NOT NULL,
`cat_img` longtext NOT NULL,
PRIMARY KEY (`id_cat`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

CREATE TABLE `subcategoria` (
`id_sub` int(11) NOT NULL auto_increment,
`subcat_nombre` varchar(50) NOT NULL,
`subcat_descripcion` longtext NOT NULL,
`categoria` int(11) NOT NULL,
PRIMARY KEY (`id_sub`),
KEY `categoria` (`categoria`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

CREATE TABLE `producto` (
`id_prod` int(11) NOT NULL auto_increment,
`nombre_prod` varchar(100) NOT NULL,
`descripcion_prod` longtext NOT NULL,
`img_prod` longtext NOT NULL,
`categoria` int(11) NOT NULL,
`subcategoria` int(11) NOT NULL,
PRIMARY KEY (`id_prod`),
KEY `categoria` (`categoria`),
KEY `subcategoria` (`subcategoria`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;