connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit(); } $i = 0; $hostType = array(); // Sets sql charset to utf-8 $mysqli->set_charset("utf8"); $result = mysqli_query($mysqli, 'SELECT 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[0]; $i = $i + 1; } ?>