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 - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -