Ver Mensaje Individual
  #21 (permalink)  
Antiguo 27/01/2014, 18:12
rakshaka
 
Fecha de Ingreso: mayo-2009
Mensajes: 166
Antigüedad: 15 años
Puntos: 2
Respuesta: Ordenar por categorias dependientes.

Intentaré bueno por las dudas a ver si tu sabes como puedo programarlo:

La tabla es esta:

Código MySQL:
Ver original
  1. CREATE TABLE IF NOT EXISTS `categorias` (
  2.   `categoria_id` bigint(200) NOT NULL,
  3.   `categoria_nombre` varchar(200) NOT NULL,
  4.   `categoria_nombre_en` varchar(200) NOT NULL
  5. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  6.  
  7. CREATE TABLE IF NOT EXISTS `productos` (
  8.   `producto_id` bigint(200) NOT NULL AUTO_INCREMENT,
  9.   `nombre` varchar(255) DEFAULT NULL,
  10.   `nombre_en` varchar(200) DEFAULT NULL,
  11.   `descripcion` text,
  12.   `descripcion_en` text,
  13.   `imagen` varchar(200) DEFAULT NULL,
  14.   `categoria_padre` int(200) NOT NULL,
  15.   PRIMARY KEY (`producto_id`)
  16. ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;