oi king again

This commit is contained in:
Rumperuu 2014-12-05 00:39:17 +00:00
parent 3539ab4edd
commit bfc00c212a

View file

@ -25,22 +25,19 @@
$sql = "SELECT HostType, COUNT(HostType) AS "Num" FROM serverlist GROUP BY HostType"; $sql = "SELECT HostType, COUNT(HostType) AS "Num" FROM serverlist GROUP BY HostType";
// Fill 2-dimensional array with article preview details $result = mysqli_query($mysqli, "SELECT HostType, COUNT(HostType) AS "Num" FROM serverlist GROUP BY HostType;");
$query = $mysqli->query($sql);
$query_num = $query->num_rows; while($row = mysqli_fetch_row($result)){
if (!empty($query_num)) // puts the value for COUNT(HostType) into $num{i}, so $num0, $num1, $num2, etc.
{ $hostType[$i] = $row[1];
while($query_row = $query->fetch_assoc()) $i = $i + 1;
{ }
// KING CUNT: Add the data from the mysqli query to the array here so it can be used...
}
}
?> ?>
<!--Load the AJAX API--> <!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript"> <script type="text/javascript">
// Load the Visualization API and the piechart package. // Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart'],['sankey'}); google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded. // Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart); google.setOnLoadCallback(drawChart);
@ -54,7 +51,6 @@
var data = new google.visualization.DataTable(); var data = new google.visualization.DataTable();
data.addColumn('string', 'hostType'); data.addColumn('string', 'hostType');
data.addColumn('number', 'hostTypeCount'); data.addColumn('number', 'hostTypeCount');
// KING CUNT: ...here
data.addRows([ data.addRows([
['CIT', <?php echo $hostTypes[0]; ?>], ['CIT', <?php echo $hostTypes[0]; ?>],
['DEV', <?php echo $hostTypes[1]; ?>], ['DEV', <?php echo $hostTypes[1]; ?>],