summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/mysqli/mysqli.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index e1542300c9..aa94fb2a70 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -777,6 +777,11 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result");
+ if ((fetchtype & MYSQLI_BOTH) == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQLI_NUM, MYSQLI_ASSOC or MYSQLI_BOTH");
+ RETURN_FALSE;
+ }
+
if (!(row = mysql_fetch_row(result))) {
RETURN_NULL();
}