Código:
while ($row = @mysql_fetch_array($result))
{
$i++;
echo "entro al while $i";
$ingeniero=$row["Nombre"];
echo "<table width='1000' border='1' align='center' cellpadding='0' cellspacing='0' bgcolor='#000099'>\n";
echo "<tr> \n";
echo "<td align='center' width='100'>$ingeniero</td> \n";
}
$result = mysql_query("SELECT COUNT(*) FROM trabajo where '$mes'=Mes and $ano=Ano and Proyecto='Plan_de_Expacion' and Ingeniero='$ingeniero'", $conexion);
if ($row = @mysql_fetch_array($result))
{
echo "<td align='center' width='100'>".$row[0]."</td> \n";
$result = mysql_query("SELECT COUNT(*) FROM trabajo where '$mes'=Mes and $ano=Ano and Proyecto='TRX_Upgrade' and Ingeniero='$ingeniero'", $conexion);
if ($row = @mysql_fetch_array($result))
{
echo "<td align='center' width='100'>".$row[0]."</td> \n";
$result = mysql_query("SELECT COUNT(*) FROM trabajo where '$mes'=Mes and $ano=Ano and Proyecto='Varios_Programable' and Ingeniero='$ingeniero'", $conexion);
if($row = @mysql_fetch_array($result))
{
echo "<td align='center' width='100'>".$row[0]."</td> \n";
$result = mysql_query("SELECT COUNT(*) FROM trabajo where '$mes'=Mes and $ano=Ano and Proyecto='Varios_No_Programable' and Ingeniero='$ingeniero'", $conexion);
if($row = @mysql_fetch_array($result))
{
echo "<td align='center' width='100'>".$row[0]."</td> \n";
$result = mysql_query("SELECT COUNT(*) FROM trabajo where '$mes'=Mes and $ano=Ano and Proyecto='Red_Troncal' and Ingeniero='$ingeniero'", $conexion);
if($row = @mysql_fetch_array($result))
{
echo "<td align='center' width='100'>".$row[0]."</td> \n";
$result = mysql_query("SELECT COUNT(*) FROM trabajo where '$mes'=Mes and $ano=Ano and Proyecto='Desmonte_BTS' and Ingeniero='$ingeniero'", $conexion);
if($row = @mysql_fetch_array($result))
{
echo "<td align='center' width='100'>".$row[0]."</td> \n";
$result = mysql_query("SELECT COUNT(*) FROM trabajo where '$mes'=Mes and $ano=Ano and Proyecto='Otros' and Ingeniero='$ingeniero'", $conexion);
if($row = @mysql_fetch_array($result))
{
echo "<td align='center' width='100'>".$row[0]."</td> \n";
$result = mysql_query("SELECT COUNT(*) FROM trabajo where '$mes'=Mes and $ano=Ano and Proyecto='Transportes' and Ingeniero='$ingeniero'", $conexion);
if($row = @mysql_fetch_array($result))
{
echo "<td align='center' width='100'>".$row[0]."</td> \n";
}
}
}
}
}
}
}
}
echo "</tr>";
echo "</table>";

