diff options
author | Derick Rethans <derick@php.net> | 2003-05-16 19:09:19 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2003-05-16 19:09:19 +0000 |
commit | 0596442eef9c3e779135966a9e80c922a4be89b6 (patch) | |
tree | 838e3ba16e91fda0cf9a4e37954c47201bf6a25f /ext/mysql/php_mysql.c | |
parent | e9b62698c7540a0f4921041c62c65cc25a9e8126 (diff) | |
download | php-git-0596442eef9c3e779135966a9e80c922a4be89b6.tar.gz |
- MFB: Fixed bug #23661: mysql_fetch_array gives no warning on an invalid
result_type
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r-- | ext/mysql/php_mysql.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |