Counting Rows with mysqli_num_rows function can provide useful pieces of data. The following example demonstrates how to gather gather distinct first names in a table sorted by date.
$names2 = “select DISTINCT firstname from table_sort WHERE date>=’2012-01-01′ “;
$result= mysqli_query($db, $names2);
$name_count2 = mysqli_num_rows($result);
echo “There are “.$name_count2.” rows.<br/><br/>”;
$myvalues=array(“After_2011” => $name_count, “Before_2011” => $name_count2);
echo “There are “.count($myvalues).” values in the array.<br/><br/>
There are “.($name_count+$name_count2).” rows in total.”;
© 2018 ALL Rights Reserved | Sitemap
Vancouver | North Vancouver | Burnaby | Richmond | Coquitlam | Port Coquitlam | Surrey | Langley | Maple Ridge | Mission | Abbotsford | Kamloops | Kelowna | Victoria | Squamish | Whistler | Pemberton