![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
04/10/2011, 11:26
|
![Avatar de Melecio](http://static.forosdelweb.com/customavatars/avatar423121_1.gif) | | | Fecha de Ingreso: julio-2011 Ubicación: Coahuila
Mensajes: 320
Antigüedad: 13 años, 7 meses Puntos: 8 | |
Respuesta: phpmysql no imprimir registros iguales MUCHAS GRACIAS YA LO HICE TE AGRADESCO POR TUS APORTACIONES
ESTA ES LA SOLUCION A LOS CAMPOS DUPLICADOS Y A LA SUMA DE ELLOS INDIVIDUALMENTE
$mysqlcapp = "SELECT DISTINCT operacion,operacion_descripcion ,numero_de_parte, cantidad from produccion where numero_de_empleado = '$OPERADORR' and fecha = '$BUSFECHA' ORDER BY operacion ASC ";
$resultadocappn = mysql_query($mysqlcapp);
$NUMERORENGLONEScapp = mysql_num_rows($resultadocappn);
while($row_tt = mysql_fetch_array($resultadocappn) ){
$OPP = $row_tt['operacion'];
$OPDES = $row_tt['operacion_descripcion'];
$NUMPARTE = $row_tt['numero_de_parte'];
$CC = $row_tt['cantidad'];
$HH = $row_tt['hrefectivas'];
$mysqlsuma = "SELECT * from produccion where operacion = '$OPP' ORDER BY operacion ASC ";
$resultadocappnsuma = mysql_query($mysqlsuma);
do {
$sumacann = $row_sumacan['cantidad'];
$canttotal += $sumacann;
} while ($row_sumacan = mysql_fetch_assoc($resultadocappnsuma));
echo' <table width="678" border="0">
<tr>
<td width="79" class="Estilo1"><div align="center">'.$OPP .'</div></td>
<td width="333" class="Estilo1"><div align="center">'.$OPDES .'</div></td>
<td width="130" class="Estilo1"><div align="center">'.$NUMPARTE.'</div></td>
<td width="65" class="Estilo1"><div align="center">'.$canttotal .'</div></td>
<td width="49" class="Estilo1"><div align="center">'.$HH.'</div></td>
</tr>
</table>';
$canttotal = 0;
} |