I am try to use the example in article http://www.phpbuilder.com/columns/wiesendanger20001218.php3
which would be perfect for a chart that I would like to have on my site
I added this so I can retrieve the information from mySQL
<?
require("config.php");
require("functions.php");
$db = mysql_connect("$Server","afcert");
mysql_select_db("afcert",$db);
$QUERY = "select unit,count(afcertstatus) as max from main2 where(SUBSTRING(afcertstatus,3,1)=0) group by unit";
$result = mysql_query($QUERY) or die ("can not connect");
$data = mysql_fetch_array($result,MYSQL_ASSOC);
/*
this is what the example used for an array
I want to plug in my data shouldnt this do it? $data = mysql_fetch_array($result,MYSQL_ASSOC);
$data = array(
"May" => 13,
"Jun" => 15,
"Jul" => 23,
"Aug" => 28,
"Sep" => 32,
"Oct" => 45,
"Nov" => 73,
"Dec" => 100);
*/
the sql works fine and is exactly what I want to show in the chart the output from it looks like this
mysql> select unit,count(afcertstatus) as max from main2 where(SUBSTRING(afcertstatus,3,1)=1) group by unit;
+--------------+-----+
| unit | max |
+--------------+-----+
| unita | 7 |
| unitb | 62 |
| unitc | 20 |
| unitd | 19 |
| unite | 5 |
| unitf | 5 |
+--------------+-----+
6 rows in set (0.04 sec)
please give me direction I have trying this for a couple days with differnt ideas
thanks
adam