Answers for "return count in mysql php"

PHP
1

php mysql count rows

$q="select * from location where community='Zoo' AND status='1'";
$res=mysqli_query($con,$q);
echo mysqli_num_rows($res);
Posted by: Guest on February-20-2022
2

get count sql query in php

$result=mysql_query("SELECT count(*) as total from Students");
$data=mysql_fetch_assoc($result);
echo $data['total'];
Posted by: Guest on February-18-2021

Browse Popular Code Answers by Language