Hey guys I have a problem with MySQL, i'm trying to insert data in a table but it's returning this error message
Here is my code
Table Tarea from database
Please help!
Fatal error: SQL: SELECT e.idtarea AS 'idTarea', e.detalle AS 'detalle', e.precio AS 'precio', e.idor AS 'idOrdenReparacion', e.fecha AS 'fecha', concat( 'Editar ', 'Eliminar' ) AS Opciones FROM Tarea e WHERE e.idtarea like '%%' ORDER BY e.idtarea;, Error: Unknown column 'e.idor' in 'field list' in /opt/lampp/htdocs/scep/tareas.php on line 76
$SQL="
SELECT e.idtarea AS 'idTarea', e.detalle AS 'detalle', e.precio AS 'precio', e.idor AS 'idOrdenReparacion', e.fecha AS 'fecha',
concat(
'<a href=\'editarTarea.php?id=',e.idtarea,'\'>Editar</a> ',
'<a href=\'eliminarTarea.php?id=',e.idtarea,'\' onclick=javascript:confirm(\'Eliminar?\')>Eliminar </a>'
) AS Opciones
FROM Tarea e ".$FILTRAR_POR." ORDER BY e.idtarea;";
$RESULT = mysql_query($SQL) or trigger_error("SQL: $SQL, Error: " . mysql_error(), E_USER_ERROR);
SELECT e.idtarea AS 'idTarea', e.detalle AS 'detalle', e.precio AS 'precio', e.idor AS 'idOrdenReparacion', e.fecha AS 'fecha',
concat(
'<a href=\'editarTarea.php?id=',e.idtarea,'\'>Editar</a> ',
'<a href=\'eliminarTarea.php?id=',e.idtarea,'\' onclick=javascript:confirm(\'Eliminar?\')>Eliminar </a>'
) AS Opciones
FROM Tarea e ".$FILTRAR_POR." ORDER BY e.idtarea;";
$RESULT = mysql_query($SQL) or trigger_error("SQL: $SQL, Error: " . mysql_error(), E_USER_ERROR);
CREATE TABLE IF NOT EXISTS `Tarea` (
`idTarea` int(11) NOT NULL AUTO_INCREMENT,
`detalle` varchar(45) COLLATE latin1_danish_ci DEFAULT NULL,
`precio` varchar(45) COLLATE latin1_danish_ci DEFAULT NULL,
`idOrdenReparacion` int(11) NOT NULL DEFAULT '0',
`fecha` date DEFAULT NULL,
PRIMARY KEY (`idTarea`,`idOrdenReparacion`),
KEY `fk_Tarea_OrdenReparacion1_idx` (`idOrdenReparacion`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_danish_ci AUTO_INCREMENT=2 ;
.....
ALTER TABLE `Tarea`
ADD CONSTRAINT `fk_Tarea_OrdenReparacion1` FOREIGN KEY (`idOrdenReparacion`) REFERENCES `OrdenReparacion` (`idOrdenReparacion`) ON DELETE NO ACTION ON UPDATE NO ACTION;
`idTarea` int(11) NOT NULL AUTO_INCREMENT,
`detalle` varchar(45) COLLATE latin1_danish_ci DEFAULT NULL,
`precio` varchar(45) COLLATE latin1_danish_ci DEFAULT NULL,
`idOrdenReparacion` int(11) NOT NULL DEFAULT '0',
`fecha` date DEFAULT NULL,
PRIMARY KEY (`idTarea`,`idOrdenReparacion`),
KEY `fk_Tarea_OrdenReparacion1_idx` (`idOrdenReparacion`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_danish_ci AUTO_INCREMENT=2 ;
.....
ALTER TABLE `Tarea`
ADD CONSTRAINT `fk_Tarea_OrdenReparacion1` FOREIGN KEY (`idOrdenReparacion`) REFERENCES `OrdenReparacion` (`idOrdenReparacion`) ON DELETE NO ACTION ON UPDATE NO ACTION;
Please help!
Comment