diff --git a/page.php b/page.php index 972a199..629a719 100644 --- a/page.php +++ b/page.php @@ -25,22 +25,19 @@ $sql = "SELECT HostType, COUNT(HostType) AS "Num" FROM serverlist GROUP BY HostType"; - // Fill 2-dimensional array with article preview details - $query = $mysqli->query($sql); - $query_num = $query->num_rows; - if (!empty($query_num)) - { - while($query_row = $query->fetch_assoc()) - { - // KING CUNT: Add the data from the mysqli query to the array here so it can be used... - } - } + $result = mysqli_query($mysqli, "SELECT HostType, COUNT(HostType) AS "Num" FROM serverlist GROUP BY HostType;"); + + while($row = mysqli_fetch_row($result)){ + // puts the value for COUNT(HostType) into $num{i}, so $num0, $num1, $num2, etc. + $hostType[$i] = $row[1]; + $i = $i + 1; + } ?>