Ver Mensaje Individual
  #6 (permalink)  
Antiguo 10/06/2010, 13:16
pepeluis1
 
Fecha de Ingreso: abril-2010
Ubicación: Colombia
Mensajes: 229
Antigüedad: 14 años, 1 mes
Puntos: 2
Respuesta: Tablas generadas en un while

mmm sip habia puesto el codigo donde no era, prueba asi:

<?php
echo "<table border = '1' cellspacing='0' cellpadding='1' bordercolor='#999999' align='center'> \n";
echo "<tr> \n";

while($registro = mysql_fetch_array($result))
{
echo "<br>";
echo "<td><table border = '1' cellspacing='0' cellpadding='1' bordercolor='#999999' align='center'> \n";
echo "<tr> \n";
echo "<td width=60 class=Estilo16><b><center>Año</center></b></td> \n";
echo "<td width=65 class=Estilo16><b><center>Mes</center></b></td> \n";
echo "<td width=50 class=Estilo16><b><center>Salidas</center></b></td> \n";
//echo "<td width=50 class=Estilo16><b><center>num_item</center></b></td> \n";
echo "</tr> \n";
do {
$num_item=$registro[0];
$anio=$registro[1];
$mes=$registro[2];
$num_personas=$registro[3];
$c_cargo=$registro[4];
$local=$registro[5];
$nom_cargo=$registro[6];
$salidas[$i]=$num_personas;
$i++;

if($mes==1){$nomMes="Enero";}
if($mes==2){$nomMes="Febrero";}
if($mes==3){$nomMes="Marzo";}
if($mes==4){$nomMes="Abril";}
if($mes==5){$nomMes="Mayo";}
if($mes==6){$nomMes="Junio";}
if($mes==7){$nomMes="Julio";}
if($mes==8){$nomMes="Agosto";}
if($mes==9){$nomMes="Septiembre";}
if($mes==10){$nomMes="Octubre";}
if($mes==11){$nomMes="Noviembre";}
if($mes==12){$nomMes="Diciembre";}
echo "<tr> \n";
echo "<td><center>".$anio."</center></td>\n";
echo "<td><center>".$nomMes."</center></td>\n";
echo "<td><center>".$num_personas."</center></td>\n";

echo "</tr> \n";
} while ($registro = mysql_fetch_array($result));

echo "</table> \n";
echo "</td> \n";

$recor++;
if (($recor % 3) == 0){
echo "</tr><tr>";
}

echo "</tr> \n";
echo "</table> \n";


}mysql_free_result($result);
$datos = (regresion_lineal($constante, $salidas));
$tendencia=$datos["m"] + $datos["b"];
$tendencia=round($tendencia,4);
echo "<table border = '1' cellspacing='0' cellpadding='1' bordercolor='#999999' align='center'> \n";
echo "<tr> \n";
echo "<td width=110 class=Estilo15><b><center>Proyección ".$nom_cargo.": </center></b></td> \n";
echo "<td width=75 class=Estilo17><b><center>$tendencia</center></b></td> \n";
echo "</tr> \n";
echo "</table> \n";

?>