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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -