getting array for bargraph
| From: | ekkehard dot pummer at neuber dot at | Date: | Fri, 01 Feb 2002 10:05:02 +0000 |
| Subject: | getting array for bargraph | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-16392@lists.php.net to get a copy of this message | ||
Hi,
I am trying to get an array of fillingstocks to output in a bargraph.
(Program used for this is chartdirector
If I do the query and output it to the browser everything seems ok - if I
try to output the result via the graph it looks like if it's only using the
last result (I'm only getting a block instead of bars).
/* connection details */
$connection = mysql_connect($server, $user, $pass)
or die ("Couldn't connect to server.");
$db = mysql_select_db($dbname, $connection)
or die ("Couldn't select database $db.");
/* query and other variables */
$order="datum desc";
$sql="SELECT * from $table WHERE $sap ORDER BY $order LIMIT 0,15"
or die ("Couldn't do sql $sql,");
/* get the data and the labels for the bar chart */
$result = mysql_query($sql);
$row = mysql_num_rows($result);
while ($row = mysql_fetch_object($result)) {
$data = $row->liter;
$labels = $row->date;
}
Any suggestions? Please help - I'm going mad with this problem !!!
Thanks in advance,
Ekkehard