]> granicus.if.org Git - php/commitdiff
added new function mysqli_stmt_data_seek
authorGeorg Richter <georg@php.net>
Tue, 15 Jul 2003 14:00:19 +0000 (14:00 +0000)
committerGeorg Richter <georg@php.net>
Tue, 15 Jul 2003 14:00:19 +0000 (14:00 +0000)
ext/mysqli/mysqli_api.c
ext/mysqli/mysqli_fe.c
ext/mysqli/php_mysqli.h

index 5749afdd335b1e37f5ddffea9cbf5ef2dbaac4c0..f5b6221be28082fb263804c8528789e1882504cc 100644 (file)
@@ -454,7 +454,7 @@ PHP_FUNCTION(mysqli_commit)
 }
 /* }}} */
 
-/* {{{ proto void mysqli_data_seek(object result)
+/* {{{ proto void mysqli_data_seek(object result, int offset)
    Move internal result pointer */
 PHP_FUNCTION(mysqli_data_seek)
 {
@@ -464,7 +464,7 @@ PHP_FUNCTION(mysqli_data_seek)
        PR_COMMAND      *prcommand;
        long            offset;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Orl", &mysql_result, mysqli_result_class_entry, &mysql_result, &offset) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_result, mysqli_result_class_entry, &offset) == FAILURE) {
                return;
        }
 
@@ -1674,6 +1674,27 @@ PHP_FUNCTION(mysqli_stmt_close)
 }
 /* }}} */
 
+/* {{{ proto void mysqli_stmt_data_seek(object stmt, int offset)
+   Move internal result pointer */
+PHP_FUNCTION(mysqli_stmt_data_seek)
+{
+       STMT            *stmt;
+       zval            *mysql_stmt;
+       PR_STMT         *prstmt;  
+       long            offset;
+
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &offset) == FAILURE) {
+               return;
+       }
+
+       MYSQLI_FETCH_RESOURCE(stmt, STMT *, prstmt, PR_STMT *, &mysql_stmt, "mysqli_stmt");
+
+
+       mysql_stmt_data_seek(stmt->stmt, offset);
+       return;
+}
+/* }}} */
+
 /* {{{ proto mixed mysqli_stmt_num_rows(object stmt)
    Return the number of rows in statements result set */
 PHP_FUNCTION(mysqli_stmt_num_rows)
index 98ba5a5e261545c96c2efbe41d4ec894d85aff38..5e0389c8cb9168e72f88e1cdd0ed715736708545 100644 (file)
@@ -116,6 +116,7 @@ function_entry mysqli_functions[] = {
        PHP_FE(mysqli_stat,                                                                     NULL)
        PHP_FE(mysqli_stmt_affected_rows,                                       NULL)
        PHP_FE(mysqli_stmt_close,                                                       NULL)
+       PHP_FE(mysqli_stmt_data_seek,                                           NULL)
        PHP_FE(mysqli_stmt_errno,                                                       NULL)
        PHP_FE(mysqli_stmt_error,                                                       NULL)
        PHP_FE(mysqli_stmt_num_rows,                                            NULL)
@@ -234,6 +235,7 @@ function_entry mysqli_stmt_methods[] = {
        PHP_FALIAS(send_long_data,mysqli_send_long_data,NULL)
        PHP_FALIAS(store_result,mysqli_stmt_store_result,NULL)
        PHP_FALIAS(close,mysqli_stmt_close,NULL)
+       PHP_FALIAS(data_seek,mysqli_stmt_data_seek,NULL)
        PHP_FALIAS(errno,mysqli_stmt_errno,NULL)
        PHP_FALIAS(error,mysqli_stmt_error,NULL)
        PHP_FALIAS(num_rows, mysqli_stmt_num_rows,NULL)
index 3e249d847a1ed43ac4debc9a5c08a5dc861016ec..c9e72588faa11a00236a69f362998ff0d96c3ed3 100644 (file)
@@ -266,6 +266,7 @@ PHP_FUNCTION(mysqli_ssl_set);
 PHP_FUNCTION(mysqli_stat);
 PHP_FUNCTION(mysqli_stmt_affected_rows);
 PHP_FUNCTION(mysqli_stmt_close);
+PHP_FUNCTION(mysqli_stmt_data_seek);
 PHP_FUNCTION(mysqli_stmt_errno);
 PHP_FUNCTION(mysqli_stmt_error);
 PHP_FUNCTION(mysqli_stmt_num_rows);