diff options
author | Derick Rethans <derick@php.net> | 2003-05-16 19:07:57 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2003-05-16 19:07:57 +0000 |
commit | 37142b284f7422dce8fd818b25b46af76397ca36 (patch) | |
tree | 52cddb2a1b899e9c80a714c283518f8326b1eeac /ext/mysql/php_mysql.c | |
parent | 217a213a5d19a8885ad43043f855124f3213f751 (diff) | |
download | php-git-37142b284f7422dce8fd818b25b46af76397ca36.tar.gz |
- 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 1e7ba432b9..2d766c4dcc 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); |