手册中有一个地方有说明,但不在官方说明里,而是在一段注释中,用foreach时,不能直接使用$value的形式
代码如下:
foreach ($ba as $key => $val) {
// oci_bind_by_name($stid, $key, $val) does not work
// because it binds each placeholder to the same location: $val
// instead use the actual location of the data: $ba[$key]
oci_bind_by_name($stid, $key, $ba[$key]);
}
这个问题很容易被忽略,而且很久都找不出原因来。