Bug #2302: odbc_execute does not seem to call SQLBindParameter
| From: | havardpe at fast dot no | Date: | Wed, 15 Sep 1999 10:33:35 +0000 |
| Subject: | Bug #2302: odbc_execute does not seem to call SQLBindParameter | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10940@lists.php.net to get a copy of this message | ||
From: havardpe@fast.no
Operating system: Windows NT 4.0
PHP version: 3.0.11
PHP Bug Type: ODBC related
Bug description: odbc_execute does not seem to call SQLBindParameter
Here is the code segment that gives me problems:
(simplified)
$conn_id = odbc_connect($db_name, $user, $pass);
$stmt = odbc_prepare($conn_id, "INSERT INTO
table (value1, value2) VALUES (?, ?)");
$data = array('test1', 'test2');
odbc_execute($stmt, &$data);
When using an Oracle database server, this produces the following error message:
Warning: SQL error: [Oracle][ODBC Oracle Driver]SQLBindParameter has not been called for parameter
#2., SQL state 07001 in SQLExecute in ...
I tried to use Access first, and got the same error (07001).
I cannot find any other ways to bind my parameters than to rely on the odbc_execute function to to
this.
NOTE: if I insert the SQL parameter values directly into the SQL statement it works fine, but I need
to pass them separate from the query to avoid quoting problems.