From: Wez Furlong Date: Fri, 21 Jan 2005 06:11:10 +0000 (+0000) Subject: picky picky. X-Git-Tag: RELEASE_0_2~201 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0162d0093d8d3a5b07cf602c1acbfd7356f4ac65;p=php picky picky. Lets make those OUTPUT rather than INPUT-OUTPUT. We need some flag from the user if they want that. --- diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 2ce017f1fa..93f2cdcd2e 100755 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -135,17 +135,20 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p } else { ctype = SQL_C_CHAR; } - rc = SQLBindParameter(S->stmt, param->paramno+1, - param->max_value_len <= 0 ? SQL_PARAM_INPUT : SQL_PARAM_INPUT_OUTPUT, + param->max_value_len <= 0 ? SQL_PARAM_INPUT : SQL_PARAM_OUTPUT, ctype, sqltype, precision, scale, Z_STRVAL_P(param->parameter), param->max_value_len <= 0 ? 0 : param->max_value_len, /* XXX: this has the wrong type for DB2 (should be SQLINTEGER*) */ &Z_STRLEN_P(param->parameter) ); - - return 1; + + if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { + return 1; + } + pdo_odbc_stmt_error("SQLBindParameter"); + return 0; } } return 1;