搜索引擎 - 具有多个参数的预准备语句

时间:2016-06-13 08:33:02

标签: php mysqli

$keyword = explode(' ',$_GET['q']);//a b c d e
foreach($keyword => value){
  params[]=$value;
}
$query ="SELECT id,english FROM product WHERE CONCAT(english,Denglish) LIKE CONCAT ('%', ?, '%') ";
$search=$mysqli->prepare($query);
$search->bind_param('s',params);
$search->execute();
$search->bind_result($id,$english);
while($row = $search->fetch()) {
    echo $english;
}

=============================================== ================================================== ================================================== ================================================== ================================================== ==============================================

0 个答案:

没有答案
相关问题