[Help] MySQL Error: Unknown column in 'field list'

Started on the old forum in November 2012 · view the original in the archive · old links redirect here

#mysql-error #php #unknown-column

1 reply · 311 views · started 14 years ago · 1 min read

2 participants
gonzzorro Newbie · 1 posts #1

Hey guys I have a problem with MySQL, i'm trying to insert data in a table but it's returning this error message

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

Here is my code

$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>&nbsp;',

  				'<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);

Table Tarea from database

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;

🤪

Please help!

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close