When I use select indicator...
in my select statement below I can't use $row[indicator]
when I use select indicator as indicator
I can use $row[indicator]
. Why is this?
$stmt=$mysqli->prepare("select indicator as indicator, count(status)as 'ok', (select count(status) from viewindicatoren where status ='niet ok' and afdelingid=? group by IND_id ) as 'nietOk' from viewindicatoren where status='ok' and afdelingid=? group by IND_id");
$stmt->bind_param("ss",$afdelingID,$afdelingID);
$stmt->execute();
$res=$stmt->get_result();
while ($row=$res->fetch_assoc()){
echo "indicator: $row[indicator] ok: $row[ok] niet ok: $row[nietOk]";
}