Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

Mysql COUNT() Functions Query

by
Category:mysql
mysql
Mysql COUNT() Functions Query

The COUNT() function returns the number of records in a select query.

To understand COUNT function, consider an products table, which is having following query

First you can need database connection in php

Code

$sql = "SELECT COUNT(id) FROM Products"; 
$result = mysqli_query($con,$sql);
while($row = mysqli_fetch_assoc($result))
{

}

0 Comments


Html code work in comment box


Related Post