我使用下面的代码来选择数据。'$ var'变量具有相同的值。如何对三次使用'$ var'一次?
$where->expression("subject like ? or contract_number like ? or description like ?",
array("%$var%","%$var%","%$var%"));
答案 0 :(得分:3)
您可以使用命名参数:
$where->expression("subject like :bob or contract_number like :bob or description like :bob",
array(":bob" => "%$var%")
);