]> granicus.if.org Git - php/commitdiff
this closes off a number of ODBC bugs.
authorDan Kalowsky <kalowsky@php.net>
Mon, 21 Jan 2002 14:11:17 +0000 (14:11 +0000)
committerDan Kalowsky <kalowsky@php.net>
Mon, 21 Jan 2002 14:11:17 +0000 (14:11 +0000)
# this is a bit hack-ish in it's functionality.  The proper answer (allowing
# users to set their cursor type) has bugs with some tests cases at this time.
#  But this is being done to just get ODBC back into working order.

ext/odbc/php_odbc.c

index 73e38156ec48f8ec13a65c1588b76b21de758a6f..e2be83169af2a4736624e4e2ad6ee022befa9567 100644 (file)
@@ -817,7 +817,7 @@ PHP_FUNCTION(odbc_prepare)
                        /* Try to set CURSOR_TYPE to dynamic. Driver will replace this with other
                           type if not possible.
                        */
-                       if (SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, SQL_CURSOR_DYNAMIC)
+                       if (SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, SQL_CURSOR_FORWARD_ONLY)
                                == SQL_ERROR) {
                                odbc_sql_error(conn, result->stmt, " SQLSetStmtOption");
                                SQLFreeStmt(result->stmt, SQL_DROP);
@@ -1159,7 +1159,7 @@ PHP_FUNCTION(odbc_exec)
                        /* Try to set CURSOR_TYPE to dynamic. Driver will replace this with other
                           type if not possible.
                         */
-                       if (SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, SQL_CURSOR_DYNAMIC)
+                       if (SQLSetStmtOption(result->stmt, SQL_CURSOR_TYPE, SQL_CURSOR_FORWARD_ONLY)
                                == SQL_ERROR) {
                                odbc_sql_error(conn, result->stmt, " SQLSetStmtOption");
                                SQLFreeStmt(result->stmt, SQL_DROP);