summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r--ext/mysqli/mysqli_api.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 876b39afc9..6a25920f93 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -1483,6 +1483,27 @@ PHP_FUNCTION(mysqli_stmt_data_seek)
}
/* }}} */
+#ifndef HAVE_MYSQLI_OLDAPI
+/* {{{ proto void mysqli_stmt_free_result(object stmt)
+ Free stored result memory for the given statement handle */
+PHP_FUNCTION(mysqli_stmt_free_result)
+{
+ STMT *stmt;
+ zval *mysql_stmt;
+
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
+ return;
+ }
+
+ MYSQLI_FETCH_RESOURCE(stmt, STMT *, &mysql_stmt, "mysqli_stmt");
+
+ mysql_stmt_free_result(stmt->stmt);
+
+ return;
+}
+/* }}} */
+#endif
+
/* {{{ proto mixed mysqli_stmt_num_rows(object stmt)
Return the number of rows in statements result set */
PHP_FUNCTION(mysqli_stmt_num_rows)