我想将请求的结果放在此数组$dataPoints1 = array
中,但它不起作用。
这是我的要求:
$sql = "
SELECT COUNT(id_etudiant)as nbre1 FROM suivre WHERE n_formation='1'
UNION
SELECT COUNT(id_etudiant)FROM suivre WHERE n_formation='2'
UNION
SELECT COUNT(id_etudiant)FROM suivre
WHERE n_formation='3'";
$result = mysqli_query($link,$sql);
while($row = mysqli_fetch_array($result)) {
$dataPoints1 = array(
array("y" => ''. $row["nbre1"].'',"label" => "formation1" ),
array("y" => ''. $row["nbre1"].'',"label" => "formation2" ),
array("y" => ''. $row["nbre1"].'',"label" => "formation3" ),
);}