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

Receive udp packets in android gstreamer -

php - Extract Text from HTTP referer -

java - Callback from new thread to class from which thread was initiated -