Get number of rows in SQL-Server with PHP

前端 未结 2 354
轮回少年
轮回少年 2021-01-21 12:43

I am fairly new to SQL-Server and PHP, but I\'m trying to get the total number of rows in my table with PHP.

This is the code I am using, it connects just fine, however

2条回答
  •  不知归路
    2021-01-21 13:07

    Check it:

    http://www.php.net/manual/es/function.sqlsrv-num-rows.php

    "sqlsrv_num_rows() — Retrieves the number of rows in a result set"

    Like:

    $row_count = sqlsrv_num_rows( $stmt);
    echo 'numRows: ',$row_count;
    

提交回复
热议问题