From: Georg Richter Date: Tue, 15 Jul 2003 14:00:19 +0000 (+0000) Subject: added new function mysqli_stmt_data_seek X-Git-Tag: BEFORE_ARG_INFO~239 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db398787e643d2582aad3bf0148f7b3d43611516;p=php added new function mysqli_stmt_data_seek --- diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 5749afdd33..f5b6221be2 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -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) diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index 98ba5a5e26..5e0389c8cb 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -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) diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h index 3e249d847a..c9e72588fa 100644 --- a/ext/mysqli/php_mysqli.h +++ b/ext/mysqli/php_mysqli.h @@ -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);