cvs: php4 /ext/odbc php_odbc.c

From: Date: Wed, 24 Apr 2002 22:07:30 +0000
Subject: cvs: php4 /ext/odbc php_odbc.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-11404@lists.php.net to get a copy of this message
kalowsky Wed Apr 24 18:07:30 2002 EDT Modified files: /php4/ext/odbc php_odbc.c Log: clearing up some code to remove any possible confusion in variable counts Index: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.123 php4/ext/odbc/php_odbc.c:1.124 --- php4/ext/odbc/php_odbc.c:1.123 Mon Apr 8 18:54:06 2002 +++ php4/ext/odbc/php_odbc.c Wed Apr 24 18:07:29 2002 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.123 2002/04/08 22:54:06 sniper Exp $ */ +/* $Id: php_odbc.c,v 1.124 2002/04/24 22:07:29 kalowsky Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1546,14 +1546,19 @@ #endif numArgs = ZEND_NUM_ARGS(); - if (numArgs == 1) { - if (zend_get_parameters_ex(1, &pv_res) == FAILURE) - WRONG_PARAM_COUNT; - } else { - if (zend_get_parameters_ex(2, &pv_res, &pv_row) == FAILURE) + switch (numArgs) { + case 1: + if (zend_get_parameters_ex(1, &pv_res) == FAILURE) + WRONG_PARAM_COUNT; + break; + case 2: + if (zend_get_parameters_ex(2, &pv_res, &pv_row) == FAILURE) + WRONG_PARAM_COUNT; + convert_to_long_ex(pv_row); + rownum = Z_LVAL_PP(pv_row); + break; + default: WRONG_PARAM_COUNT; - convert_to_long_ex(pv_row); - rownum = Z_LVAL_PP(pv_row); } ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result); @@ -1647,7 +1652,7 @@ } if (result->fetched == 0) { - /* User forgot to call odbc_fetchrow(), let's do it here */ + /* User forgot to call odbc_fetch_row(), or wants to reload the results, do it now */ #ifdef HAVE_SQL_EXTENDED_FETCH if (result->fetch_abs) rc = SQLExtendedFetch(result->stmt, SQL_FETCH_NEXT, 1, &crow,RowStatus);

« previous php.cvs (#11404) next »