I have a query as follows, I get the response and for some reason the while loop never catches the first group of status returned. If MySQL returned status I,S,N
it will only process the S
and N
. If it returns S,N
it will only process N
.
$sql = "SELECT COUNT(*) as cnt, status
FROM itemInterest
GROUP BY status
ORDER BY STATUS";
echo $sql;
$rs = mysql_query($sql);
while($row = mysql_fetch_array($rs))
{
echo $row['status'];
if($row['status'] == "N") {
$noResponse = $row['cnt'];
}
if($row['status'] == "S") {
$saved = $row['cnt'];
}
if($row['status'] == "I") {
$interested = $row['cnt'];
}
if($row['status'] == "X") {
$noThanks = $row['cnt'];
}
}