I appreciate your patience with me.
What I shared was it... there's not more code. Perhaps that's the problem.
This worked, returned the expected result, but executed before the HTML and therefore appeared at the top of the page before the HTML tag:
//COUNT TIES
$result = $rim -> query
("SELECT a.judge, a.score, COUNT(*) AS count FROM students a
INNER JOIN students b ON a.score = b.score
WHERE ((a.id <> b.id)
AND (a.judge LIKE '$judgeid'))
GROUP BY a.score
ORDER BY COUNT(*) DESC");
while ($row = mysqli_fetch_object($result)) {
print $row->count . ' students are tied with ' . $row->score . '<br />';
}
//END COUNT TIES
This doesn't return the result:
//COUNT TIES
$tied_score_query = $rim->query('SELECT a.judge, a.score, COUNT(*) AS count FROM students a INNER JOIN students b ON a.score = b.score WHERE (a.id <> b.id) AND (a.judge LIKE "$judgeid") GROUP BY a.score ORDER BY COUNT(*) DESC');
$tied_scores = $tied_score_query->fetch_all();
foreach($tied_scores AS $tied_score) {
print $tied_score['count'] . ' students are tied with ' . $tied_score['score'] . '<br />';
}
//END COUNT TIES
Then in the body of the HTML:
<?php
print_r($tied_scores);
?>
Returns: Array ()
I laterally close the connection on the next line, start the HTML, and attempt to "print_r"... same result.