insert - 表中未记录的字段
INSERT INTO `jos1_content`
(`title`, `introtext`, `fulltext`, `state`, `sectionid`, `catid`, `attribs`)
VALUES
($title, $introtext, $fulltext, 1, 1, $catid, 5)
查询由 php 脚本组成。变量的推导表明它们不为空。 在 phpMyAdmin 的请求下显示错误:
1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解在 ' 附近使用的正确语法
INSERT INTO `jos1_content`
(`title`, `introtext`, `fulltext`, `state`, `sectionid`, `catid`, `attribs`)
VALUES
($title, $introtext, $fulltext, 1, 1, $catid, 5)
Query is made up of php script. Derivation of variables shows that they are not empty.
At the request of phpMyAdmin shows the error:
1064 - 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 '
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要使用单引号来指示 SQL 字符串 - 使用:
更安全的方法是使用:
参考:
You need to use single quotes to indicate strings to SQL - use:
A safer means would be to use:
Reference:
您需要用引号将要插入字符串类型字段的 PHP 变量引起来:
You need to surround your PHP variables that are being inserted into string-type fields with quotes:
阅读您的编程语言手册中有关准备好的语句的信息或使用
mysql_escape_string
。Read about prepared statements in the manual of your programming language or use
mysql_escape_string
.