From: Derick Rethans Date: Fri, 16 May 2003 19:09:19 +0000 (+0000) Subject: - MFB: Fixed bug #23661: mysql_fetch_array gives no warning on an invalid X-Git-Tag: RELEASE_1_0_2~789 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0596442eef9c3e779135966a9e80c922a4be89b6;p=php - MFB: Fixed bug #23661: mysql_fetch_array gives no warning on an invalid result_type --- diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index f2bd945493..46138c08c8 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -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);