如何正确准备和执行odbc连接

时间:2016-07-19 15:33:33

标签: php sql-server-2008

我在尝试准备和执行语句时遇到以下错误:

  

转换规范的字符值无效,SQLExecute中的SQL状态22005

我能做些什么来避免这个错误吗?

if (isset($_POST['end'])) {
    foreach ($_POST['items'] as $checked) {
        $sql = "UPDATE oeprcfil_sql SET end_dt=? WHERE cd_tp_1_cust_no =? AND cd_tp_1_item_no =? AND ID =?";
        $prepare = odbc_prepare($conn, $sql);
        $end_dt = $checked['end_dt'];
        $cus_no = $checked['cus_no'];
        $item_no = $checked['item_no'];
        $id = $checked['ID'];

        odbc_execute(
            $prepare,
            array($end_dt, $cus_no, $item_no, $id)
        );
    }
}

0 个答案:

没有答案