问题
I've read my threads about this problem but I still don't know how to solve it.
Error SQL query:
--
-- Dump data for table `bi_instituicoes`
--
INSERT INTO `bi_instituicoes` (`id`, `Instituicao`, `Morada`, `Código Postal`, `Localidade`, `País`)
VALUES (1, 'Escola Secundária D. Afonso Sanches', 'Alameda Flâmula Pais', NULL, 'Vila do Conde ', 'Portugal'),
(2, 'Escola Secundária da Boa Nova', 'Av. dos Combatentes da Grande Guerra', NULL, 'Leça da Palmeira ', 'Portugal'),
(3, 'Escola Secundária da Maia', 'Avenida Luís Camões', '4470-322', 'Maia', 'Portugal'),
(4, 'Escola Secundária de Almeida Garrett', 'Praceta Doutor José Sampaio', NULL, 'Vila Nova de Gaia ', 'Portugal'),
(5, 'Escola Secundária de José Gomes Ferreira', 'Rua José Sebastião e Silva', NULL, 'Lisboa', 'Portugal'),
(6, 'Escola Secundária de Monserrate', 'R. Monserrate', NULL, 'Viana do Castelo ', 'Portugal'),
(7, 'Escola Secundária de Paredes', 'R. Engenheiro Adelino A Costa , Castelões Cepeda', NULL, 'Paredes', 'Portugal'),
(8, 'Escola Secundária de Raúl Proença, Leiria ', 'Rua João II[...]
MySQL said: Documentation
#1054 - Unknown column 'id' in 'field list'
回答1:
After hours of frustration with this issue, and trying to insert using every possible acceptable syntax, I found that the problem was a trigger on the table that I was inserting on. I haven't been able to find out why the Trigger caused the problem, but removing it allowed my inserts to work again...
回答2:
This can also be due to messed up triggers. Sometimes a show triggers
can help.
回答3:
Perhaps the table bi_instituicoes
has no such field id
- check its structure.
Or if your Mysql by 5 version change query to:
--
-- Dump data for table `bi_instituicoes`
--
INSERT INTO `bi_instituicoes`
VALUES (1, 'Escola Secundária D. Afonso Sanches', 'Alameda Flâmula Pais', NULL, 'Vila do Conde ', 'Portugal'),
(2, 'Escola Secundária da Boa Nova', 'Av. dos Combatentes da Grande Guerra', NULL, 'Leça da Palmeira ', 'Portugal'),
(3, 'Escola Secundária da Maia', 'Avenida Luís Camões', '4470-322', 'Maia', 'Portugal'),
(4, 'Escola Secundária de Almeida Garrett', 'Praceta Doutor José Sampaio', NULL, 'Vila Nova de Gaia ', 'Portugal'),
(5, 'Escola Secundária de José Gomes Ferreira', 'Rua José Sebastião e Silva', NULL, 'Lisboa', 'Portugal'),
(6, 'Escola Secundária de Monserrate', 'R. Monserrate', NULL, 'Viana do Castelo ', 'Portugal'),
(7, 'Escola Secundária de Paredes', 'R. Engenheiro Adelino A Costa , Castelões Cepeda', NULL, 'Paredes', 'Portugal'),
(8, 'Escola Secundária de Raúl Proença, Leiria ', 'Rua João II[...]
回答4:
Try to replace:
INSERT INTO `bi_instituicoes` (`id`, ...
with:
INSERT INTO `bi_instituicoes` (id,
My guess is that the column id
is not lower-case. This kind of confusion happens to many people.
回答5:
Simple solution is that a string must be within double quotations "
.
Example:
INSERT INTO `bi_instituicoes`
VALUES (1, "Escola Secundária D. Afonso Sanches", "Alameda Flâmula Pais", NULL, "Vila do Conde ", "Portugal");
来源:https://stackoverflow.com/questions/21112839/1054-unknown-column-id-in-field-list-phpmyadmin