是否有任何功能可以从描述中搜索单词并返回从该单词开始或仅返回该搜索单词之前的单词的描述?
如果这是描述..
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.
我想搜索“打印”这个词。结果必须像这样显示..
printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
或者
the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
结果将显示我正在搜索的单词或仅搜索单词之前的一个单词。
最佳答案
您应该在此处阅读有关 MySQL 内置函数的信息: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html
SELECT SUBSTRING(description FROM LOCATE('printing', description))
...
关于php - 从描述中搜索单词并返回从该单词开始的描述,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40200301/