hello everyone,
Help pls. I encounter "server error" with the last sql query statement in the last 'for' loop. Here is the code:
$qdev=mysql_query("select distinct(device) from wipdataperarea where creation_date like '$today%' and gtc='AL' order by gtc,device");
$device=mysql_num_rows($qdev);
while ($dev=mysql_fetch_assoc($qdev)) {
echo "<tr>";
echo "<td>" . $dev['device']. "</td>";
$qarea=mysql_query("select distinct(area2) from wipdataperarea where creation_date
like '$today%' and gtc='AL'");
$result=mysql_num_rows($qarea);
for ($i="0"; $i<($area=mysql_fetch_assoc($qarea)); $i++) {
$query=mysql_query("select distinct(wip_pro), description from
wipdataperarea where creation_date like '$today%' and area2 = '" .
$area['area2'] . "' and gtc='AL'");
$count=mysql_num_rows($query);
for ($x="0"; $x<($row=mysql_fetch_assoc($query)); $x++) {
$sql=mysql_query("select count from wipdataperarea where
creation_date like '$today%' and device = '" . $dev['device'] .
"' and area2 = '" . $area['area2'] . "' and wip_pro = '" .
$row['wip_pro'] . "' and description = '" .
$row['description'] . "' and gtc='AL'");
$cnt=mysql_num_rows($sql);
for ($y="0"; $y<($count=mysql_fetch_assoc($sql)); $y++) {
echo "<td>" . $count['count']. "</td>";
}
}
}
echo "</tr>";
}
echo "</tr>";