Finding and printing most common value within MySql database using PHP -


i have code retrieve values, don't know how return modal value in array.

$stuff = "select count (subjectno) subjectallocation"; $direct = mysqli_query($link, $stuff);  while($row = mysqli_fetch_array($direct)){     echo $row['count (subjectno)'];     echo "<br />"; } 

i understand performing count, want define base start from.

here 1 method getting "mode" -- statistical term common value:

select subjectno subjectallocation group subjectno order count(*) desc limit 1; 

Comments

Popular posts from this blog

php - Extract Text from HTTP referer -

Receive udp packets in android gstreamer -

authentication - ASP.NET Core 1.0. Bearer Token, cannot access custom claims -