Sorting by

×

Standings New

'calendar.instone.com', 'username' => 'u34lawbrggszh', 'password' => 't^#@jb2pk@cC', 'database' => 'dbdrx3xhnw9omr', ); $mysqli = new mysqli($db["hostname"], $db["username"], $db["password"], $db["database"]); // Check connection if ($mysqli -> connect_errno) { echo "Failed to connect to MySQL: " . $mysqli -> connect_error; exit(); } // Perform query $query = "SELECT * FROM view_team_rankings "; if ($result = $mysqli->query($query)) { // Check if there are any rows returned if ($result->num_rows > 0) { // Initialize a variable to keep track of the current division $currentDivision = ''; // Display the table structure echo ""; echo ""; echo ""; echo ""; echo ""; // Fetch and display the data while ($row = $result->fetch_assoc()) { // Check if the division has changed if ($row['Notes'] !== $currentDivision) { $currentDivision = $row['Notes']; echo ""; } // Display team information echo ""; echo ""; echo ""; echo ""; } // Close the table structure echo ""; echo "
NameScore
Division: " . $currentDivision . "
" . $row['Name'] . "" . (2 * $row['TotalScore']) . "
"; } else { echo "No teams found."; } // Free result set $result->free_result(); } else { echo "Query error: " . $mysqli->error; } // Closes connection $mysqli->close(); ?>