我試圖創建一個非常簡單和基本的搜索腳本獲取錯誤。在搜索腳本[PHP,mysqli的]
這是我迄今所做的:
include('config.php');
$search_token =$_POST['search_token'];
$search_query = mysqli_query($conn, "SELECT Forname FROM idea WHERE post_des LIKE '%$search_token%'");
while($row = mysqli_fetch_array($search_query))
{
$idea_body = $row['post_des'];
echo $idea_body;
}
但是,當我執行此,我有如下警告:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in F:\Server\xampp\htdocs\p\c3\search.php on line 34
對於這種情況任何幫助嗎?
什麼是表結構? – ripa
迴應您的查詢並確保其正確執行。 –
請關注'$ search_token = $ _POST ['search_token']'。你可以SQL注入自己:) –