我想知道如何在搜索数据库中搜索更多表以包含城市和搜索。城市和搜索已经在我的数据库中,我需要做的就是搜索它们,但我不知道如何。让PHP搜索一切
这是我到目前为止有:
//explode out search term
$search_exploded = explode(" ",$search);
foreach($search_exploded as $search_each) {
//construct query
$x++;
if ($x==1)
$construct .= " keywords LIKE '%$search_each%'";
else
$construct .= " OR keywords LIKE '%$search_each%'";
}
哪些错误?你应该展示它。 – KingCrunch 2011-06-14 00:35:33
不是像解析错误那样的错误,但它只会搜索关键字。我只想在搜索中包含城市和州,因为它们在同一张表 – user796834 2011-06-14 00:36:18
请复制/粘贴您收到的错误。 – helloandre 2011-06-14 00:38:00