如果它们在数组中,如何使用先前查询的结果查询数据库?以下是我到目前为止所拥有的。
$query = "SELECT * from searchtestdb where engname in ( SELECT synonyms.synonym FROM words LEFT JOIN synonyms ON synonyms.word_id = words.word_id WHERE word LIKE '%$searchBox%') ";
while($result = mysql_fetch_array($query))
{
echo $result['engname'];
echo "<br> ";
echo "<br> ";
}
如何获取 $result['engname'] 并再次查询?我在想类似的东西
SELECT * from searchtestdb where engname LIKE '%$result['engname']%';
但这显然行不通。有任何想法吗?