Mysqli Undefined索引数组json

时间:2017-06-07 13:43:28

标签: php mysqli

我注意到了sum metode:“未定义索引:PGW最大活跃用户数”

$a=mysqli_query($koneksi, "SELECT sum(`PGW maximum active subscribers`) as count FROM ggsn_4g_pdp_max");
	$b=mysqli_query($koneksi, "SELECT sum('SGW maximum active subscribers') as count FROM ggsn_4g_pdp_max");
	$c=mysqli_query($koneksi, "SELECT sum('SPGW maximum active subscribers') as count FROM ggsn_4g_pdp_max");
	
	
    $pgw_array=array();
    $sgw_array=array();
    $spgw_array=array();
    
	
    while($r=mysqli_fetch_array($a)){
        $pgw_array[]= $r["PGW maximum active subscribers"];
	}
	while($g=mysqli_fetch_array($b)){
        $sgw_array[]= $g["SGW maximum active subscribers"];
	}
	 while($n=mysqli_fetch_array($c)){
        $spgw_array[]= $n["SPGW maximum active subscribers"];
	}

我怎么能修好......?请

1 个答案:

答案 0 :(得分:0)

您必须使用别名count$r["count"]