plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [{
name: 'Not Completed',
data: [<?php echo json_encode($TotalNotCompleted); ?>]
/* here how to write query to fetch data from database, to make my graph work dynamically */
}, {
name: 'Completed',
data: [<?php echo json_encode($TotalCompleted); ?>]
}]
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [
<?
$QueryTST=mysql_query("SELECT * FROM TotalCounterSales WHERE AdminCity='$City' AND AdminStore='$StoreNo' AND SalesDate='$TodaysDate'");
while($RowQTST=mysql_fetch_array($QueryTST))
{
$ProductNo=$RowQTST['ItemNo'];
$QueryProductName=mysql_query("SELECT * FROM products WHERE PId='$ProductNo' ");
while($RowQPN=mysql_fetch_array($QueryProductName))
{
$ProductName=$RowQPN['name'];
}
?>
{ name: "<?echo $ProductName;?>", data: [<?echo $RowQTST['Quantity'];?>]},
<?}?>
]
这篇关于使用图形时无法从数据库中获取数据到脚本标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!