我设计了一个网页,用于搜索数据库中问题的答案,并向数据库中插入更多问题和答案。它可以在我的本地主机上完美运行,但不能在互联网上运行,它可以成功插入数据,但不会对数据进行搜索。选择查询不起作用,请问可能是什么问题
$question = strtolower($input);
$question = str_replace('?', '', $question);
$question = trim($question);
echo "<br/>";echo "<br/>";echo "<br/>";echo "<br/>";echo "<br/>";echo "<br/>";echo "$question";
print_r($result = mysqli_query($conn, "SELECT * FROM chatbot WHERE LOWER(question) like '%$question%'"));
print_r($fetched_data = mysqli_fetch_all($result, MYSQLI_ASSOC));
$row_cnt = $result->num_rows;
$rand = rand(0, $row_cnt - 1);
if ($row_cnt > 0) {
return $fetched_data[$rand]['answer'];
} else
return "Am sorry, this question wasn't found,Please ENTER TRAIN:QUESTION#ANSWER#password to make me smarter";