diff options
author | Georg Richter <georg@php.net> | 2003-06-22 08:46:39 +0000 |
---|---|---|
committer | Georg Richter <georg@php.net> | 2003-06-22 08:46:39 +0000 |
commit | 5655ebe6f26301f0f087623f8e8508be73b3cbcc (patch) | |
tree | 6f7f2a8db6e9dadb6ab455fc9a4b7005baa0f901 /ext/mysqli/mysqli_api.c | |
parent | bb37c9c335128f9095c4173d5f0fe22efc80ce5c (diff) | |
download | php-git-5655ebe6f26301f0f087623f8e8508be73b3cbcc.tar.gz |
added new function mysqli_stmt_num_rows
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r-- | ext/mysqli/mysqli_api.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 2b4f52ad85..3f85c08355 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1700,6 +1700,25 @@ PHP_FUNCTION(mysqli_stmt_close) } /* }}} */ +/* {{{ proto mixed mysqli_stmt_num_rows(object stmt) + Return the number of rows in statements result set */ +PHP_FUNCTION(mysqli_stmt_num_rows) +{ + STMT *stmt; + zval *mysql_stmt; + my_ulonglong rc; + PR_STMT *prstmt; + + 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 *, prstmt, PR_STMT *, &mysql_stmt, "mysqli_stmt"); + + rc = mysql_stmt_num_rows(stmt->stmt); + MYSQLI_RETURN_LONG_LONG(rc) +} +/* }}} */ + /* {{{ proto string mysqli_select_db(object link, string dbname) Select a MySQL database */ PHP_FUNCTION(mysqli_select_db) |