@@ -1995,10 +1995,10 @@ PHP_FUNCTION(odbc_result_all)
1995
1995
}
1996
1996
1997
1997
/* Start table tag */
1998
- if (ZEND_NUM_ARGS () == 1 ) {
1999
- php_printf ("<table><tr>" );
2000
- } else {
1998
+ if (pv_format != NULL ) {
2001
1999
php_printf ("<table %s ><tr>" , pv_format );
2000
+ } else {
2001
+ php_printf ("<table><tr>" );
2002
2002
}
2003
2003
2004
2004
for (i = 0 ; i < result -> numcols ; i ++ ) {
@@ -2284,7 +2284,6 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
2284
2284
size_t db_len , uid_len , pwd_len ;
2285
2285
zend_long pv_opt = SQL_CUR_DEFAULT ;
2286
2286
odbc_connection * db_conn ;
2287
- int cur_opt ;
2288
2287
2289
2288
ZEND_PARSE_PARAMETERS_START (1 , 4 )
2290
2289
Z_PARAM_STRING (db , db_len )
@@ -2294,19 +2293,17 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
2294
2293
Z_PARAM_LONG (pv_opt )
2295
2294
ZEND_PARSE_PARAMETERS_END ();
2296
2295
2297
- cur_opt = pv_opt ;
2298
-
2299
- if (ZEND_NUM_ARGS () > 3 ) {
2300
- /* Confirm the cur_opt range */
2301
- if (! (cur_opt == SQL_CUR_USE_IF_NEEDED ||
2302
- cur_opt == SQL_CUR_USE_ODBC ||
2303
- cur_opt == SQL_CUR_USE_DRIVER ||
2304
- cur_opt == SQL_CUR_DEFAULT ) ) {
2305
- zend_argument_value_error (4 , "must be one of SQL_CUR_USE_IF_NEEDED, "
2306
- "SQL_CUR_USE_ODBC, or SQL_CUR_USE_DRIVER" );
2307
- RETURN_THROWS ();
2308
- }
2296
+ if (
2297
+ pv_opt != SQL_CUR_DEFAULT
2298
+ && pv_opt != SQL_CUR_USE_IF_NEEDED
2299
+ && pv_opt != SQL_CUR_USE_ODBC
2300
+ && pv_opt != SQL_CUR_USE_DRIVER
2301
+ ) {
2302
+ zend_argument_value_error (4 , "must be one of SQL_CUR_USE_IF_NEEDED, "
2303
+ "SQL_CUR_USE_ODBC, or SQL_CUR_USE_DRIVER" );
2304
+ RETURN_THROWS ();
2309
2305
}
2306
+ int cur_opt = (int ) pv_opt ;
2310
2307
2311
2308
if (!ODBCG (allow_persistent )) {
2312
2309
persistent = 0 ;
0 commit comments