|  |  | 
          
            | สอบถามเกี่ยวกับเรื่อง Googlechart กับ ajax และ json หน่อยครับ 
 
 
  ฐานข้อมูล
 
 
  code Query
 
 Code (PHP)
 
 $sql_job  = "select sum(irp_profit) as profit, irp_month from "._TB_REPORT_PROFIT_." group by irp_month";
$qry_job = mysql_query($sql_job);
$month_arr=array(1=>'ม.ค',2=>'ก.พ',3=>'มี.ค',4=>'เม.ย',5=>'พ.ค',6=>'มิ.ย',7=>'ก.ค',8=>'ส.ค',9=>'ก.ย',10=>'ต.ค',11=>'พ.ย',12=>'ธ.ค'); 
$no = 0;
$data[] = array("Month","Profit");
$num = mysql_num_rows($qry_job);
while($arr = mysql_fetch_array($qry_job))
{
	$no++;
	
	foreach($month_arr as $key_m => $val_m){  
		//$data[] = array($val_m,(int)$arr['profit']);
	}		
	$data[] = array($arr['irp_month'],(int)$arr['profit']);
}
echo json_encode($data);  
 
  
 
  Graph
 1 4 7 8 อันนี้คือเดือนนะครับ
 
 
 พอดีอยากจะให้ในส่วนกราฟ แสดงข้อมูล เดือน ตั้งแต่ ม.ค. ถึง ธ.ค. ครับ แต่ไม่เข้าใจว่าจะนำค่าดังกล่าวไปใช่ยังไงครับ
 
 รบกวนข้อคำแนะนำหน่อยครับ
 
 
 
 Tag : PHP
 
 
 |  
            |  |  
            | 
              
                |  |  |  |  
                |  | 
                    
                      | Date :
                          2014-04-26 21:37:54 | By :
                          asustak | View :
                          741 | Reply :
                          2 |  |  |  
                |  |  |  |  |  
            |  |  
		            |  |