@@ -925,7 +925,7 @@ PHP_FUNCTION(odbc_prepare)
925
925
/* Try to set CURSOR_TYPE to dynamic. Driver will replace this with other
926
926
type if not possible.
927
927
*/
928
- SQLSetStmtOption (result -> stmt , SQL_CURSOR_TYPE , ODBCG (default_cursortype ));
928
+ SQLSetStmtAttr (result -> stmt , SQL_ATTR_CURSOR_TYPE , ( SQLPOINTER ) ODBCG (default_cursortype ), 0 );
929
929
}
930
930
} else {
931
931
result -> fetch_abs = 0 ;
@@ -1312,7 +1312,7 @@ PHP_FUNCTION(odbc_exec)
1312
1312
/* Try to set CURSOR_TYPE to dynamic. Driver will replace this with other
1313
1313
type if not possible.
1314
1314
*/
1315
- SQLSetStmtOption (result -> stmt , SQL_CURSOR_TYPE , ODBCG (default_cursortype ));
1315
+ SQLSetStmtAttr (result -> stmt , SQL_ATTR_CURSOR_TYPE , ( SQLPOINTER ) ODBCG (default_cursortype ), 0 );
1316
1316
}
1317
1317
} else {
1318
1318
result -> fetch_abs = 0 ;
@@ -2146,7 +2146,7 @@ bool odbc_sqlconnect(zval *zv, char *db, char *uid, char *pwd, int cur_opt, bool
2146
2146
}
2147
2147
#else
2148
2148
if (cur_opt != SQL_CUR_DEFAULT ) {
2149
- rc = SQLSetConnectOption (link -> connection -> hdbc , SQL_ODBC_CURSORS , cur_opt );
2149
+ rc = SQLSetConnectAttr (link -> connection -> hdbc , SQL_ATTR_ODBC_CURSORS , ( SQLPOINTER ) ( intptr_t ) cur_opt , 0 );
2150
2150
if (rc != SQL_SUCCESS ) { /* && rc != SQL_SUCCESS_WITH_INFO ? */
2151
2151
odbc_sql_error (link -> connection , SQL_NULL_HSTMT , "SQLSetConnectOption" );
2152
2152
return false;
@@ -2647,7 +2647,7 @@ PHP_FUNCTION(odbc_autocommit)
2647
2647
CHECK_ODBC_CONNECTION (conn );
2648
2648
2649
2649
if (!pv_onoff_is_null ) {
2650
- rc = SQLSetConnectOption (conn -> hdbc , SQL_AUTOCOMMIT , pv_onoff ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF );
2650
+ rc = SQLSetConnectAttr (conn -> hdbc , SQL_ATTR_AUTOCOMMIT , ( SQLPOINTER ) ( intptr_t ) ( pv_onoff ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF ), 0 );
2651
2651
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
2652
2652
odbc_sql_error (conn , SQL_NULL_HSTMT , "Set autocommit" );
2653
2653
RETURN_FALSE ;
@@ -2656,7 +2656,7 @@ PHP_FUNCTION(odbc_autocommit)
2656
2656
} else {
2657
2657
SQLINTEGER status ;
2658
2658
2659
- rc = SQLGetConnectOption (conn -> hdbc , SQL_AUTOCOMMIT , ( PTR ) & status );
2659
+ rc = SQLGetConnectAttr (conn -> hdbc , SQL_ATTR_AUTOCOMMIT , & status , SQL_IS_INTEGER , NULL );
2660
2660
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
2661
2661
odbc_sql_error (conn , SQL_NULL_HSTMT , "Get commit status" );
2662
2662
RETURN_FALSE ;
@@ -2758,7 +2758,7 @@ PHP_FUNCTION(odbc_setoption)
2758
2758
php_error_docref (NULL , E_WARNING , "Unable to set option for persistent connection" );
2759
2759
RETURN_FALSE ;
2760
2760
}
2761
- rc = SQLSetConnectOption (link -> connection -> hdbc , ( unsigned short ) pv_opt , pv_val );
2761
+ rc = SQLSetConnectAttr (link -> connection -> hdbc , pv_opt , ( SQLPOINTER ) pv_val , 0 );
2762
2762
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
2763
2763
odbc_sql_error (link -> connection , SQL_NULL_HSTMT , "SetConnectOption" );
2764
2764
RETURN_FALSE ;
@@ -2772,7 +2772,7 @@ PHP_FUNCTION(odbc_setoption)
2772
2772
result = Z_ODBC_RESULT_P (pv_handle );
2773
2773
CHECK_ODBC_RESULT (result );
2774
2774
2775
- rc = SQLSetStmtOption (result -> stmt , ( unsigned short ) pv_opt , pv_val );
2775
+ rc = SQLSetStmtAttr (result -> stmt , pv_opt , ( SQLPOINTER ) pv_val , 0 );
2776
2776
2777
2777
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO ) {
2778
2778
odbc_sql_error (result -> conn_ptr , result -> stmt , "SetStmtOption" );
0 commit comments