Answers for "php mysql select count number of rows"

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
0

count sql query in php

$sql = "SELECT COUNT(*) AS total from Members";
$result = $conn->query($sql);
$data =  $result->fetch_assoc();
echo $data['total'];
Posted by: Guest on December-23-2020
0

mysql count rows php

<?php
$con = mysqli_connect("localhost","root","","test");
if (!$con) 
{
  die('Could not connect: ' . mysqli_error());
}

$result = mysqli_query("select COUNT(*) FROM table");
$row = mysqli_fetch_array($result);

$total = $row[0];
echo "Total rows: " . $total;

mysqli_close($con);
?>
Posted by: Guest on February-17-2022

Code answers related to "php mysql select count number of rows"

Browse Popular Code Answers by Language