If the user input:
"I want to tell you that I hate you"
OR
"I hate"
Output: NULL / No data found
BUT
function exitHandler(options, err) {
connection.end();
if (options.cleanup)
console.log('clean');
if (err)
console.log(err.stack);
if (options.exit)
process.exit();
}
//do something when app is closing
process.on('exit', exitHandler.bind(null, {cleanup: true}));
我尝试了SQL QUERY:MATCH AGAINST ...
但是当我只输入“我讨厌”时,它会返回
输出:“哦,不,我为你感到难过”。它必须返回任何内容,因为短语是
数据库上的数据不相等“我讨厌自己”。
感谢帮助......对此有何正确的解答。
答案 0 :(得分:0)
这个怎么样
SELECT Response FROM mytable WHERE 'I Hate Myself' LIKE CONCAT('%', UserInput, '%');