]> granicus.if.org Git - php/commitdiff
- MFB: Fixed bug #23661: mysql_fetch_array gives no warning on an invalid
authorDerick Rethans <derick@php.net>
Fri, 16 May 2003 19:09:19 +0000 (19:09 +0000)
committerDerick Rethans <derick@php.net>
Fri, 16 May 2003 19:09:19 +0000 (19:09 +0000)
  result_type

ext/mysql/php_mysql.c

index f2bd94549316173e20a31344336c02f505541d2a..46138c08c8e4354ccb8b1f563724adbefac5191f 100644 (file)
@@ -1876,6 +1876,10 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
                        WRONG_PARAM_COUNT;
                        break;
        }
+
+       if ((result_type & MYSQL_BOTH) == 0) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH.");
+       }
        
        ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);