<?php
$search_input = $_POST["search_input"];
include_once("connection_to_db.php");
if(!isset($search_input))
{
print("Nothing to search !");
return;
}
//Queries products where the search input is similiar to the title, artist or format of a product
$query_search = "SELECT * FROM waxItem WHERE title OR artist LIKE '%".$search_input."%'";
$query_search_result = mysql_query($query_search)
or die(mysql_error());
$num_rows_search = mysql_num_rows($query_search_result);
?>
当我添加“或艺术家”时,上面的代码不起作用。
当仅将一个字段与数据库记录进行比较时,该代码确实有效并且显示了搜索结果。
我究竟做错了什么?