如何在 php foreach 循环中编写 mysql where 子句。这是我的代码
$outPut = Array ( [0] => 'intel' [1] => 'amd' );
$Query = select * from laptop
foreach($outPut as $Filtervalues)
{
$Query .= "where processor like '%$Filtervalues%'";
}
echo $Query;
但我的输出不正确。
我希望输出为
select * from laptop where (processor like '%intel%' or processor like '%amd%')