我想在这样的查询中绑定变量:
SELECT people.name, conf.id
FROM people, conf
WHERE people.confid=conf.id AND people.name LIKE :c1 AND conf.name LIKE :c2
绑定(我尝试使用一个非常简单的表达式):
$tmp = '%';
$tmp2= '%';
oci_bind_by_name($statement, ':c1', $tmp);
oci_bind_by_name($statement, ':c2', $tmp2);
警告:oci_execute() [function.oci-execute]: ORA-01008: not all variables bound in ....php on line 162
如果我动态生成查询,使用:{$tmp} 而不是:c1,它可以工作。
有任何想法吗?
谢谢!