From 0596442eef9c3e779135966a9e80c922a4be89b6 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 16 May 2003 19:09:19 +0000 Subject: - MFB: Fixed bug #23661: mysql_fetch_array gives no warning on an invalid result_type --- ext/mysql/php_mysql.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/mysql/php_mysql.c') 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); -- cgit v1.2.1