function searchPaste($string, $err=false)
{
global $sql;
$buffer = $err?"SELECT * FROM `pastes` WHERE `exposure` = 'public' AND `title` LIKE ? OR `paste` LIKE ? OR `lang` LIKE ?":"SELECT * FROM `pastes` WHERE `exposure` = 'public' AND `title` LIKE ?";
echo $buffer."<br>";
$buffer = $sql->prepare($buffer);
$buffer->execute(array(sprintf("%%%s%%", $string)));
if(!$buffer->rowCount()>0)
return 0;
return $buffer->fetchAll(PDO::FETCH_OBJ);
}
正如您在我的第一个查询中看到的,我通过多个案例匹配问题是“?” 只处理一次,我不确定如何使用数组为所有原因执行此操作。
有谁知道我能做什么?