1

I am getting the following error when trying to prepare and execute a statement:

Invalid character value for cast specification, SQL state 22005 in SQLExecute

Is there something I can do differently to avoid this error?

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)
        );
    }
}
Danila Ganchar
  • 10,266
  • 13
  • 49
  • 75
Ryan
  • 303
  • 5
  • 16

0 Answers0