get count sql query in php
$result=mysql_query("SELECT count(*) as total from Students");
$data=mysql_fetch_assoc($result);
echo $data['total'];
get count sql query in php
$result=mysql_query("SELECT count(*) as total from Students");
$data=mysql_fetch_assoc($result);
echo $data['total'];
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);
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us