mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
added new function mysqli_stmt_num_rows
This commit is contained in:
parent
bb37c9c335
commit
5655ebe6f2
3 changed files with 22 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -114,6 +114,7 @@ function_entry mysqli_functions[] = {
|
|||
PHP_FE(mysqli_stmt_close, NULL)
|
||||
PHP_FE(mysqli_stmt_errno, NULL)
|
||||
PHP_FE(mysqli_stmt_error, NULL)
|
||||
PHP_FE(mysqli_stmt_num_rows, NULL)
|
||||
#if MYSQL_VERSION_ID >= 40101
|
||||
PHP_FE(mysqli_stmt_sqlstate, NULL)
|
||||
#endif
|
||||
|
@ -231,6 +232,7 @@ function_entry mysqli_stmt_methods[] = {
|
|||
PHP_FALIAS(close,mysqli_stmt_close,NULL)
|
||||
PHP_FALIAS(errno,mysqli_stmt_errno,NULL)
|
||||
PHP_FALIAS(error,mysqli_stmt_error,NULL)
|
||||
PHP_FALIAS(num_rows, mysqli_stmt_num_rows,NULL)
|
||||
#if MYSQL_VERSION_ID >= 40101
|
||||
PHP_FALIAS(sqlstate, mysqli_stmt_sqlstate,NULL)
|
||||
#endif
|
||||
|
|
|
@ -263,6 +263,7 @@ PHP_FUNCTION(mysqli_stmt_affected_rows);
|
|||
PHP_FUNCTION(mysqli_stmt_close);
|
||||
PHP_FUNCTION(mysqli_stmt_errno);
|
||||
PHP_FUNCTION(mysqli_stmt_error);
|
||||
PHP_FUNCTION(mysqli_stmt_num_rows);
|
||||
#if MYSQL_VERSION_ID >= 40101
|
||||
PHP_FUNCTION(mysqli_stmt_sqlstate);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue