Running one single instance of the justgage which retrieves the "count" value of my select statement (Which I've retrieved from the net) This is working fine. It shows the amount of issues where the prio(ority) equals 2.
Here's my challenge. I wish to have 5 gauges, for each gauge I want to its value to be retrieved and showed from the database. However I can't figure out the $query command.
This is my php part:
<?php
// connect to the database
include('connect-db.php');
// Make a MySQL Query and assign variable
$query = "SELECT COUNT(prio) as prio_a FROM ticket WHERE prio=2";
//assign result to a variable
$result = mysql_query($query) or die(mysql_error());
//fetch result as an associative array
$data = mysql_fetch_assoc($result) or die(mysql_error());
?>
This is my gauge:
<div id="r1"></div>
<script>
var r1 = new JustGage({
id: "r1",
value: <?php echo $data['prio_a']; ?>,
min: 0,
max: 100,
title: "Prio Geen",
label: "PRIORITEIT"
});
</script>
My idea was: A second gauge would look like this?
<div id="r1"></div>
<script>
var r2 = new JustGage({
id: "r2",
value: <?php echo $data['prio_b']; ?>,
min: 0,
max: 100,
title: "Prio Geen",
label: "PRIORITEIT"
});
</script>
Hopefully I can then continue with even more gauges (Five for 'priorities', Nine for 'status", Eight for 'type of issues' and two for 'open/closed tickets')
Any help, ideas would be appreciated.