|
|
|
js กับ php ครับ ผมต้องการนำค่าจากตัวแปร php -> ($data_muang_aqi) ใส่ บรรทัด data[0] ไม่รู้ว่าจะทำยังไง? |
|
|
|
|
|
|
|
ผมต้องการนำค่าจากตัวแปร php -> ($data_muang_aqi) ใส่ บรรทัด data[0] ไม่รู้ว่าจะทำยังไง?
Code (PHP)
$sql=
"SELECT * FROM tb_warn_air ".
"WHERE MONTH(date_warn_air)='$m' AND YEAR(date_warn_air)='$y' ORDER BY date_warn_air ASC";
$query=mysql_query($sql);
$num_rows = mysql_num_rows($query);
While($rs = mysql_fetch_assoc($query)){
$date_air = $rs["date_warn_air"];
$muang_aqi = $rs['muang_aqi'];
$maemo_aqi = $rs['maemo_aqi'];
$soppad_aqi = $rs['soppad_aqi'];
$tahsee_aqi = $rs['tahsee_aqi'];
$data_muang_aqi[]=$muang_aqi;
$data_maemo_aqi[]=$maemo_aqi;
$data_soppad_aqi[]=$soppad_aqi;
$data_soppad_aqi[]=$soppad_aqi;
}
<script language="javascript">
<?
for($p=0;$p<=$num_rows;$p++){
echo ','.$data_muang_aqi[$p];
}
?>
var data = new Array();
//Data for each product
data[0] = new Array("Product A", _______________________________ );
data[1] = new Array("Product B",546300,436500,546500,332500);
data[2] = new Array("Product C",657600,564600,348600,436600);
data[3] = new Array("Product D",436500,765700,453900,326400);
//Flag indicating whether our chart has loaded
var chartLoaded = false;
</script>
Tag : - - - -
|
|
|
|
|
|
Date :
2010-06-15 15:55:09 |
By :
oasiis |
View :
819 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data[0] = new Array("Product A", "<?=$data_muang_aqi?>" );
|
|
|
|
|
Date :
2010-06-15 16:56:06 |
By :
xbeginner01 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|