我这样做插入查询:SQL语法错误?
INSERT INTO `giornale`.`Articolo`
(`id_articolo`, `titolo`, `didascalia`, `testo`, `immagine`,
`username_r`, `data_art`, `autore`, `id_categoria`, `numero_like`)
VALUES (NULL, \'titoloooo\', \'ciao ciao\', \'texttttt\', \'immag\',
\'admin\', NOW(), \'prova\', \'3\', NULL);
,如果我在phpMyAdmin SQL编辑器中启动它,它工作正常。但如果我在我的PHP脚本中这样做,它返回我这个错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'titoloooo\', \'ciao ciao\', \'texttttt\', \'immag\', \'admin\', NOW(), \'prova' at line 1
我该如何解决这个问题?
非常感谢!
看起来你正在逃避你需要的引号。 – Wiseguy 2012-03-30 15:30:43
你能告诉我们PHP代码吗?你真的逃避你的SQL编辑器中的单引号吗?肯定会失败。 – MichaelRushton 2012-03-30 15:31:45