与描述相反,该函数并不总是执行查询,除非您尝试获取结果。我通过以下代码发现了这一点
<?php
$result = ibase_query($dbh,"SELECT boniid FROM PROC_INS_OBONI_DELIV_ADDBONITM ( ? , ? , ? , ? , null , ? )", $bon_id , $plucode2 , $amount , $note , $discount);
$this->log_add(mb_convert_encoding("SELECT boniid FROM PROC_INS_OBONI_DELIV_ADDBONITM ( " . $bon_id . ", " . $plucode2 . ", " . $amount . ", " . $note . ", " . $nullparent . ", " . $discount . " )",'utf8','cp1251'));
if (!$result){
$errmsg = ibase_errmsg();
ibase_rollback($dbh);
ibase_close($dbh);
$this->log_add("Item (" . $mid . " - " . $plucode2 . ") : Error returned (" . __LINE__ . ") : " . $errmsg);
return "Error sending product ( $m_name). Error message: $errmsg";
}
$row = ibase_fetch_assoc($result);
?>
这个问题可能仅限于 FireBird 1.5,也可能不限于此。无论如何,请谨慎使用。