Thank you Walter,
here are the 4 tables structure, by the way, you can see it working on
http://www.hostudio.com/fieldlab in case you want to play with it, this is a test run
CREATE TABLE `equipos` (
`indice_equipo` int(11) NOT NULL auto_increment,
`host_name` varchar(18) NOT NULL default 'ccslab-',
`mod_equipo` varchar(20) NOT NULL default '',
`tipo_equipo` varchar(10) default NULL,
`equipo_status` varchar(10) default NULL,
`equipo_num_as` varchar(5) default NULL,
`equipo_puerto_as` char(3) default NULL,
`equipo_ubicacion` varchar(15) default NULL,
`equipo_comentario` varchar(50) default NULL,
PRIMARY KEY (`indice_equipo`),
UNIQUE KEY `host_name` (`host_name`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
CREATE TABLE `puertos` (
`indice_puerto` int(11) NOT NULL auto_increment,
`puerto_equipo` int(11) default NULL,
`puerto_tipo` varchar(18) default NULL,
`puerto_nombre` varchar(10) default 'fa/0/0/0',
`puerto_ip` varchar(15) default '10.96.253.',
`puerto_comentario` varchar(50) default NULL,
PRIMARY KEY (`indice_puerto`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
CREATE TABLE `switchmatrix_equipo` (
`indice_switch` int(11) NOT NULL auto_increment,
`switch_equipo` varchar(18) default 'ccslab-sm',
`switch_ip` varchar(15) default NULL,
`switch_modelo` varchar(15) default NULL,
PRIMARY KEY (`indice_switch`),
UNIQUE KEY `switch_equipo` (`switch_equipo`),
UNIQUE KEY `switch_ip` (`switch_ip`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
CREATE TABLE `swtichm_puertos` (
`indice_switchm` int(11) NOT NULL auto_increment,
`switchm_equipo` int(11) default NULL,
`switchm_modulo` varchar(4) default NULL,
`switchm_puerto` varchar(8) default NULL,
`switchm_patch` varchar(6) default NULL,
`switchm_from` int(11) default NULL,
`switchm_status` varchar(4) default NULL,
PRIMARY KEY (`indice_switchm`),
UNIQUE KEY `switchm_patch` (`switchm_patch`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
Just in case it helps you understand what i'm trying to do, here are the translations for the caption and/or field names:
indice = index
equipo = equipment
modulo = module
puerto = port
modelo = model
comentario = comments
nombre = name
ubicación = location
tipo = type.
Thank you very much for your help, i've tried to create the sentence with the info you gave me, replacing the field names for the actual fieldnames but i get a syntax error, obviously i'm doing something wrong

, i understand the logic but í'm lost about sql syntax, as told before, i generated it using a code generator called appgini, just modified the box adding the concatenat
