Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #count #rows #php
ADD COMMENT
Topic
Name
4+2 =