0
You want to insert 4 values in the table, but the table only has 3 columns.
Something else in the column nome
varchar(10) will not contain names with more than 10 letters, so increase this length.
Since the first column is numerical and sequential, just create a column id
which automatically increments a value with each new Insert in the table
CREATE TABLE IF NOT EXISTS `livros` (
`id` INT NOT NULL,
`nome` VARCHAR(60) NOT NULL,
`autor` VARCHAR(60) NOT NULL,
`codliv` INT(2) NOT NULL,
PRIMARY KEY (`codliv`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `livros` (`nome`, `autor`, `codliv`) VALUES
('O grande Conflito', 'Ellen White', 1),
('O capital', 'Karl Marx', 1),
('O Manifesto Comunista', 'Karl Marx', 3),
('A Ideologia Alema', 'Karl Marx', 1);
Can you post the code text? Images is bad for us to respond. Just copy and paste here.
– Maniero
You insert data into just three columns and send the database to insert data into four columns, so it doesn’t work! You have to have Insert into (column1, column2) values (valor1, valor2)
– Renato Junior
Show @Renatosilva
– Ricardo Souza