]> granicus.if.org Git - php/commitdiff
added new function mysql_stmt_free_result
authorGeorg Richter <georg@php.net>
Wed, 10 Mar 2004 09:50:05 +0000 (09:50 +0000)
committerGeorg Richter <georg@php.net>
Wed, 10 Mar 2004 09:50:05 +0000 (09:50 +0000)
ext/mysqli/mysqli_api.c
ext/mysqli/mysqli_fe.c
ext/mysqli/php_mysqli.h

index 876b39afc9bbc35bfef84b803905e77f243e7638..6a25920f9385227ed1fc9acffcec312c11a069fc 100644 (file)
@@ -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)
index 6c83c1df7114674a9d8df8336bbfd0c4de777af1..dbbbbb301de53363941bb2d90243d080eb0444d5 100644 (file)
@@ -124,6 +124,9 @@ function_entry mysqli_functions[] = {
        PHP_FE(mysqli_stmt_bind_param,                                          third_arg_force_by_ref_rest)
        PHP_FE(mysqli_stmt_bind_result,                                         second_arg_force_by_ref_rest)
        PHP_FE(mysqli_stmt_fetch,                                                       NULL)
+#ifndef HAVE_MYSQLI_OLDAPI
+       PHP_FE(mysqli_stmt_free_result,                                         NULL)
+#endif
        PHP_FE(mysqli_stmt_param_count,                                         NULL)
        PHP_FE(mysqli_send_query,                                                       NULL)
 #ifdef HAVE_EMBEDDED_MYSQLI
@@ -267,6 +270,7 @@ function_entry mysqli_stmt_methods[] = {
        PHP_FALIAS(send_long_data,mysqli_stmt_send_long_data,NULL)
        PHP_FALIAS(stmt,mysqli_prepare,NULL)
 #ifndef HAVE_MYSQLI_OLDAPI
+       PHP_FALIAS(free_result,mysqli_stmt_free_result,NULL)
        PHP_FALIAS(prepare,mysqli_stmt_prepare, NULL)
 #endif
        PHP_FALIAS(store_result,mysqli_stmt_store_result,NULL)
index 7d1032ec5127fb9febbb28a1612a9643ed79c9d6..a19c51eaa1d2028ec76d0190a4907bce908e9670 100644 (file)
@@ -347,6 +347,9 @@ PHP_FUNCTION(mysqli_stmt_close);
 PHP_FUNCTION(mysqli_stmt_data_seek);
 PHP_FUNCTION(mysqli_stmt_errno);
 PHP_FUNCTION(mysqli_stmt_error);
+#ifndef HAVE_MYSQLI_OLDAPI
+PHP_FUNCTION(mysqli_stmt_free_result);
+#endif
 PHP_FUNCTION(mysqli_stmt_num_rows);
 #if MYSQL_VERSION_ID >= 40101
 PHP_FUNCTION(mysqli_stmt_sqlstate);