Hi there -Â
I figured out how to put my data into a JSON format using PHP and MySQL, see below. Â Now, could someone please help me create, say, a pie chart with Google Charts. Â I have not done this before, and I could use some help creating it. Â
<?php
// Connect to MySQL
include ("./mylibrary/login.php");
login();
// Fetch the data
$query = "
  SELECT priority, COUNT(*) AS num_count\n"
   . " FROM issue\n"
   . " GROUP BY priority ";
$result = mysql_query( $query );
// All good?
if ( !$result ) {
// Nope
$message  = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die( $message );
}
// Print out rows
$prefix = '';
echo "[\n";
while ( $row = mysql_fetch_assoc( $result ) ) {
echo $prefix . " {\n";
echo ' Â "priority": "' . $row['priority'] . '",' . "\n";
echo ' Â "num_count": ' . $row['num_count'] . Â "\n";
echo " }";
$prefix = ",\n";
}
echo "\n]";
?> Â
Thank you,Â
Hugo