Escape input data in SQL queries when using ODBC + Access
问题 I've tried odbc_prepare() + odbc_execute() to update a record in an Access file but I always get an SQL state 07001 error message about incorrect column count (actually, the message is in Spanglish and doesn't make much sense): <?php $items = array(); $items[100] = 'Foo'; $items[200] = 'Bar'; $sql = 'UPDATE street SET name=? WHERE street_id=?'; $stmt = odbc_prepare($conection, $sql); if( $stmt===FALSE ){ die(odbc_errormsg()); } foreach($items as $cod => $name){ if( !odbc_execute($stmt, array(