Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/09/2013, 03:33
dankko
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Insertar multiples registros con checkbox

Si, sigo enredado la verdad.

Dejo las tablas

Código MySQL:
Ver original
  1. CREATE TABLE IF NOT EXISTS `cat3_subgeneral` (
  2.   `id_subgeneral` int(7) NOT NULL AUTO_INCREMENT,
  3.   `nombre_subgeneral` varchar(100) NOT NULL,
  4.   `id_pregeneral` int(7) NOT NULL,
  5.   `id_general` int(7) NOT NULL,
  6.   PRIMARY KEY (`id_subgeneral`)

Código MySQL:
Ver original
  1. CREATE TABLE IF NOT EXISTS `fabricante` (
  2.   `id_fabricante` int(7) NOT NULL AUTO_INCREMENT,
  3.   `nombre_fabricante` varchar(250) NOT NULL,
  4.   PRIMARY KEY (`id_fabricante`)


Código MySQL:
Ver original
  1. CREATE TABLE IF NOT EXISTS `marcas` (
  2.   `id_marca` int(7) NOT NULL AUTO_INCREMENT,
  3.   `nombre_marca` varchar(250) NOT NULL,
  4.   `ruta` varchar(250) NOT NULL,
  5.   PRIMARY KEY (`id_marca`)
Código MySQL:
Ver original
  1. CREATE TABLE IF NOT EXISTS `modelo` (
  2.   `id_modelo` int(7) NOT NULL AUTO_INCREMENT,
  3.   `nombre_modelo` varchar(250) NOT NULL,
  4.   `id_marca` int(11) NOT NULL,
  5.   `ruta` varchar(250) NOT NULL,
  6.   PRIMARY KEY (`id_modelo`)

Código MySQL:
Ver original
  1. CREATE TABLE IF NOT EXISTS `productos` (
  2.   `id_producto` int(7) NOT NULL AUTO_INCREMENT,
  3.   `nombre_producto` varchar(250) NOT NULL,
  4.   `referencia` varchar(250) NOT NULL,
  5.   `id_fabricante` int(7) NOT NULL,
  6.   `id_subgeneral` int(7) NOT NULL,
  7.   `compatible` int(20) DEFAULT NULL,
  8.   PRIMARY KEY (`id_producto`)

La relación con la tabla productos la hago con la tabla subcategoria, y modelo.
Donde compatible en la tabla productos, es el ID del modelo, con los que el producto es compatible.

Saludos.