Gracias por tu ayuda, lo que pasa es que son varias sentencias y al final se construye la tabla imprimiendo los datos, al colocarlo asi me da errores
Código PHP:
$conexion = obtenerConexion();
$sql22 = "SELECT * FROM cant1 INNER JOIN tconfigurador_dx ON cant1.solicitud=tconfigurador_dx.cSolicitud INNER JOIN tactividades ON tconfigurador_dx.cActividad=tactividades .tActividades WHERE cStatus=0 GROUP BY cActividad" ;
$res418 = mysql_query($sql22, $conexion);
while($row = mysql_fetch_array($res418)) {
$act=$row['cActividad'];
$sol=$row['solicitud'];
$color = '#FFFF00';
$sql4 = "SELECT * FROM cant1 INNER JOIN tconfigurador_dx ON cant1.solicitud = tconfigurador_dx.cSolicitud INNER JOIN tactividades ON tconfigurador_dx.cActividad= tactividades .tActividades WHERE idtiem=0 && actividad='$act' && cStatus=0 GROUP BY solicitud" ;
$res = mysql_query($sql4, $conexion);
$num_filas2=mysql_num_rows($res);
while($row = mysql_fetch_array($res)) {
$item = $row['idtiem'];
}
$sql5 = "SELECT * FROM cant1 INNER JOIN tconfigurador_dx ON cant1.solicitud = tconfigurador_dx.cSolicitud INNER JOIN tactividades ON tconfigurador_dx.cActividad= tactividades .tActividades WHERE idtiem=1 && actividad='$act'&& cStatus=0 GROUP BY solicitud" ;
$res1 = mysql_query($sql5, $conexion);
$num_filas3=mysql_num_rows($res1);
while($row = mysql_fetch_array($res1)) {
$item1 = $row['idtiem'];
}
$sql6 = "SELECT * FROM cant1 INNER JOIN tconfigurador_dx ON cant1.solicitud = tconfigurador_dx.cSolicitud INNER JOIN tactividades ON tconfigurador_dx.cActividad= tactividades .tActividades WHERE idtiem=2 && actividad='$act' && cStatus=0 GROUP BY solicitud" ;
$res2 = mysql_query($sql6, $conexion)or die (mysql_error());
$num_filas4=mysql_num_rows($res2);
while($row = mysql_fetch_array($res2)) {
$item2 = $row['idtiem'];
}
$sql7 = "SELECT * FROM cant1 INNER JOIN tconfigurador_dx ON cant1.solicitud = tconfigurador_dx.cSolicitud INNER JOIN tactividades ON tconfigurador_dx.cActividad= tactividades .tActividades WHERE idtiem=3 && actividad='$act' && cStatus=0 GROUP BY solicitud" ;
$res3 = mysql_query($sql7, $conexion)or die (mysql_error());
$num_filas5=mysql_num_rows($res3);
while($row = mysql_fetch_array($res3)) {
$item3 = $row['idtiem'];
}
$sql8 = "SELECT * FROM cant1 INNER JOIN tconfigurador_dx ON cant1.solicitud = tconfigurador_dx.cSolicitud INNER JOIN tactividades ON tconfigurador_dx.cActividad= tactividades .tActividades WHERE actividad='$act' && idtiem=4 && cStatus=0 GROUP BY solicitud" ;
$res4 = mysql_query($sql8, $conexion);
$num_filas6=mysql_num_rows($res4);
while($row = mysql_fetch_array($res4)) {
$item4 = $row['idtiem'];
}
$sql9 = "SELECT * FROM cant1 INNER JOIN tconfigurador_dx ON cant1.solicitud = tconfigurador_dx.cSolicitud INNER JOIN tactividades ON tconfigurador_dx.cActividad= tactividades .tActividades WHERE actividad='$act' && idtiem=5 && cStatus=0 GROUP BY solicitud" ;
$res5 = mysql_query($sql9, $conexion);
$num_filas7=mysql_num_rows($res5);
while($row = mysql_fetch_array($res5)) {
$item5 = $row['idtiem'];
}
echo "<tr> \n";
echo "<td>$act</td> \n";
echo "<td bgcolor=#FFFF00><a href='detallesconfdx.php?actividad=".$act."&&idtiem=".$item."'>".$num_filas2."</a></td> \n";
echo "<td bgcolor=#FF0000><a href='detallesconfdx.php?actividad=".$act."&&idtiem=".$item1."'>".$num_filas3."</a></td> \n";
echo "<td bgcolor=#FF9933><a href='detallesconfdx.php?actividad=".$act."&&idtiem=".$item2."'>".$num_filas4."</a></td> \n";
echo "<td><a href='detallesconfdx.php?actividad=".$act."&&idtiem=".$item3."'>".$num_filas5."</a></td> \n";
echo "<td><a href='detallesconfdx.php?actividad=".$act."&&idtiem=".$item4."'>".$num_filas6."</a></td> \n";
echo "<td><a href='detallesconfdx.php?actividad=".$act."&&idtiem=".$item5."'>".$num_filas7."</a></td> \n";
echo "</tr> \n";
}