Convert ODBC SQL query to use prepared statements
问题 I'm using ODBC (Win32) to connect to our Pervasive SQL database. I have post variables that I need to insert into SQL queries and later extract individual rows. Here's an example of what I have so far but isn't working for some reason: $sql_bin2=odbc_prepare($conn,'SELECT TOP 1 icitemo.value FROM icitemo WHERE icitemo.itemno = ? AND icitemo.optfield = ?'); $result_bin2=odbc_execute($sql_bin2, array($barcode, $var_bin2)); while (odbc_fetch_row($result_bin2)) { $bin2=odbc_result($result_bin2,