summaryrefslogtreecommitdiff
path: root/ext/odbc/php_odbc.c
diff options
context:
space:
mode:
authorDan Kalowsky <kalowsky@php.net>2002-04-24 22:07:29 +0000
committerDan Kalowsky <kalowsky@php.net>2002-04-24 22:07:29 +0000
commit55e43151d556af68b8a66e245e295adef2ffa16d (patch)
treeb22a9171ca5f736fa27041482d56c843b93014e4 /ext/odbc/php_odbc.c
parente46f57b6fbc4635cc2a05c3ccffe47aa27325eb6 (diff)
downloadphp-git-55e43151d556af68b8a66e245e295adef2ffa16d.tar.gz
clearing up some code to remove any possible confusion in variable counts
Diffstat (limited to 'ext/odbc/php_odbc.c')
-rw-r--r--ext/odbc/php_odbc.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 4a7b214d6f..6ee3e8f7e2 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -1546,14 +1546,19 @@ PHP_FUNCTION(odbc_fetch_row)
#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 @@ PHP_FUNCTION(odbc_result)
}
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);