0
Out of the blue my querys are no longer accepted by my BD. That’s both by the site in php and direct with an INSERT in phpmyadmin. See if you can shed a light:
CREATE TABLE `despesas` (
`id` int(11) NOT NULL,
`desc` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`venc` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`valor` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`recibo` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
And this is my query in php:
$query = "INSERT INTO despesas (desc, venc, valor, recibo) values('$desc', '$venc', '$val', '" . $rec . "')";
$salva = mysqli_query(BDConexao(), $query);
If I try to insert direct into phpmyadmin also will not:
INSERT INTO despesas (desc, venc, valor, recibo) values('AWS Amazon', '05/02/2017', '25,00', 'Chrysanthemum.jpg')
So I ask you, would something be wrong with my database?
The
desc
is a reserved word from Mysql, already tried using`desc`, between ``.– Inkeliz
Check this out: http://answall.com/questions/109125/mysql-palavras-chaves-reservadas
– Inkeliz
Thank you very much, it worked.
– Jose Gilson
Possible duplicate of Mysql reserved keywords
– Inkeliz