From bfc00c212ac4313db1562c0c9aeea21f3132806e Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Fri, 5 Dec 2014 00:39:17 +0000 Subject: [PATCH] oi king again --- page.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) 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; + } ?>