sql全文返回null
我正在使用 joomla CMS 写入我的数据库并编写了一个自定义前端。
我正在尝试获取“全文”行的内容。我尝试过 mysql_fetch_assoc['fulltext'] 和 mysql_result($sql, 0, 'fulltext') 。两者都返回全文。这是查询字符串:
SELECT created, modified, title, introtext, 'fulltext', state, urls, created_by
FROM table_content
WHERE id='$id'
这可能是我错过的非常明显的东西,因为全文似乎与没有引号的 sql 冲突。
任何帮助将一如既往!
I'm using the joomla CMS to write to my db and have written a custom front end.
I'm trying to obtain the contents of the 'fulltext' row. I've tried mysql_fetch_assoc['fulltext']
and mysql_result($sql, 0, 'fulltext')
. Both return fulltext. Here's the query string:
SELECT created, modified, title, introtext, 'fulltext', state, urls, created_by
FROM table_content
WHERE id='$id'
It's probably something really obvious I've missed because fulltext seems to conflict with sql without the quotation marks around it.
Any assistance would as always be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 SQL 关键字作为字段名称,并使用反引号进行适当的转义。您使用的是单引号,这会将单词转换为包含单词“fulltext”的字符串。
尝试
一下。
You can use SQL keywords as field names, with appropriate escaping with backticks. You're using single quotes, which turns the word into a string that contains the word "fulltext".
Try
instead.