MySQL 全文反对()
我正在尝试使用 MySQL 全文创建一个搜索页面。
我有一个带有文本框的搜索页面:
< FORM NAME ="form1" METHOD ="POST" ACTION ="catalog.php?action=<?php echo $title; ?>">
我将用户的输入传递到另一个运行查询的网页 (catalog.php):
"SELECT * FROM books WHERE MATCH (title) AGAINST (???)"
我在 against()
函数中放置什么?
该参数需要从最后一页提取用户的输入。
I am trying to create a search page with MySQL fulltext.
I have a search page with a textbox:
< FORM NAME ="form1" METHOD ="POST" ACTION ="catalog.php?action=<?php echo $title; ?>">
I pass the user's input to another webpage (catalog.php) which runs the query:
"SELECT * FROM books WHERE MATCH (title) AGAINST (???)"
What do I place in the against()
function?
The argument needs to extract the user's input from the last page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 MySQL 手册,您将关键字放在反对函数。
虽然我建议使用 GET 进行搜索。 页面刷新时没有“确定您要再次发布”对话框,您可以在没有表单的情况下修改搜索条件。
According to the MySQL Manual you place the keywords in the against function.
Although i suggest using GET for search. No "Sure you want to post again" dialog on a page-refresh and you can modify the search criteria without the form.