The total number of rows count using PHP and MySQL .you can count using two methods. First of all, you can use the count() function. You have to need to define the count() function under the MySQL query.
$sql="select count('1') from users";
We have used = count(1) function also we can use count(*) replace count(1) because. COUNT(*) counts the number of rows. Since both 0 and 1 are non-null values, COUNT(0)=COUNT(1) and they both will be equivalent to the number of rows COUNT(*). That is a different concept, but the result produce will be the same
The second method -
In the second method, you count the MySQL table rows using
mysqli_num_rows();
mysqli_num_rows(); function helps you count the MySQL table rows .
TOTAL NUMBER OF ROWS COUNT USING PHP AND MYSQL