My first question is, has anyone used a PHP/SWF charts before, and if so have you had any problems with it. My second question is, is there anything wrong with the following code. I'm trying to set up an array that will populate a flash chart with database info.
$data_key = $_GET['item_id'];
include "charts.php";
//start the PHP multi-dimensional array and create the region titles
$chart [ 'chart_data' ][ 0 ][ 0 ] = "";
$chart [ 'chart_data' ][ 1 ][ 0 ] = "Number $data_key ";
require "db_connect.php";
//get the smallest year to determine which year to start the chart with
$result = mysql_query("SELECT MIN(game) AS MinGame FROM bankroll WHERE number = '$data_key'");
$MinGame = mysql_result ( $result, 0, "MinGame" );
//get all the data in the Growth table
$result = mysql_query ("SELECT * FROM bankroll WHERE number = '$data_key'");
//extract the data from the query result one row at a time
for ( $i=0; $i < mysql_num_rows($result); $i++ ) {
//determine which row in the PHP array the current data belongs to
switch ( mysql_result ( $result, $i, "number" ) ) {
case " Number $data_Key ":
$row = 1;
break;
}
//determine which column in the PHP array the current data belongs to
$col = mysql_result ( $result, $i, "game") - $MinGame + 1;
//populate the PHP array with the game title
$chart [ 'chart_data' ][ 0 ][ $col ] = mysql_result ( $result, $i, "game");
//populate the PHP array with the bank data
$chart [ 'chart_data' ][ $row ][ $col ] = mysql_result ( $result, $i, "Bank");
}