diff options
author | Dan Kalowsky <kalowsky@php.net> | 2002-02-26 15:33:54 +0000 |
---|---|---|
committer | Dan Kalowsky <kalowsky@php.net> | 2002-02-26 15:33:54 +0000 |
commit | a4113ee734600f0a77b6cbe0b04864c7933fdba5 (patch) | |
tree | 2231cd4d24b6baf9b6e8da8bc784f00728ffad05 /ext/odbc | |
parent | 0bbc3c3a4cffbc3da4b4d28911ba044997c4929e (diff) | |
download | php-git-a4113ee734600f0a77b6cbe0b04864c7933fdba5.tar.gz |
Bug fix 15719 as submited by Joseph Southwell and allows NULL values in ODBC
# I haven't been able to fully test this due to MacOSX compliation errors.
# if someone in the QA group could that'd be appriciated.
Diffstat (limited to 'ext/odbc')
-rw-r--r-- | ext/odbc/php_odbc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 949a3e08b7..e71b80b647 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -875,6 +875,7 @@ PHP_FUNCTION(odbc_execute) } params_t; params_t *params = NULL; char *filename; + unsigned char otype; SWORD sqltype, ctype, scale; SWORD nullable; UDWORD precision; @@ -925,6 +926,8 @@ PHP_FUNCTION(odbc_execute) efree(params); RETURN_FALSE; } + + otype = (*tmp)->type; convert_to_string(*tmp); if (Z_TYPE_PP(tmp) != IS_STRING) { php_error(E_WARNING,"Error converting parameter"); @@ -984,6 +987,10 @@ PHP_FUNCTION(odbc_execute) #ifdef HAVE_DBMAKER precision = params[i-1].vallen; #endif + if (otype == IS_NULL) { + params[i-1].vallen = SQL_NULL_DATA; + } + rc = SQLBindParameter(result->stmt, (UWORD)i, SQL_PARAM_INPUT, ctype, sqltype, precision, scale, Z_STRVAL_PP(tmp), 0, |