Tema: loop???
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/04/2005, 20:27
Avatar de pekeña
pekeña
 
Fecha de Ingreso: enero-2005
Ubicación: CONCEPCION
Mensajes: 57
Antigüedad: 19 años, 3 meses
Puntos: 0
loop???

Código PHP:
php 
tengo este codigo k me consulta bien pero se me repiten los datos nose por que sera el while? o necesitare un contador para los id? ayuda!!




<html>
<body bgcolor="#FFFFFF">
<title>modificar item </title>
<?php

$conexion = mysql_connect("localhost", "root", "");
if (! $conexion)
{
echo "<h2 align='center'>ERROR: Imposible establecer conexión con el servidor</h2>";
exit;
}
mysql_select_db("mi base", $conexion);

$result = mysql_query("SELECT di.id,di.numdi,di.estadodi_codestado,emprtrans.nom transp,emprtrans.nomempr,crt.numcrt,item.mezcla,it em.merc,item.kneto,item.codaran,item.cant_merc from di,emprtrans,item,crt WHERE item.di_numdi='$di.numdi'",$conexion);
echo "<center>Elige un registro de la lista para modificar:<br></center><br><br>";
echo "<center><table border = '1' bgcolor='#E1E1E1'> \n";
echo "<form method='post' action='edita4.php'>";
while ($row = mysql_fetch_row($result))
{
echo "<tr> \n";
echo "<td> <font color='#330066' size=3><input type=submit name='id' value=$row[0]> </font> </td> \n";
echo "<td> <font color='#330066' size=3> $row[1] </font> </td> \n";
echo "<td> <font color='#330066' size=3> $row[2] </font> </td> \n";
echo "<td> <font color='#330066' size=3> $row[3] </font></td> \n";
echo "<td> <font color='#330066' size=3> $row[4] </font></td> \n";
echo "<td> <font color='#330066' size=3> $row[5] </font></td> \n";
echo "<td> <font color='#330066' size=3> $row[6] </font></td> \n";
echo "<td> <font color='#330066' size=3> $row[7] </font></td> \n";
echo "<td> <font color='#330066'size=3> $row[8] </font></td> \n";
echo "<td> <font color='#330066' size=3> $row[9] </font></td> \n";
echo "<td> <font color='#330066'size=3> $row[10] </font></td> \n";
echo "<td> <font color='#330066' size=3> $row[11] </font></td> \n";
echo "<td> <font color='#330066' size=3> $row[12] </font></td> \n";
echo "<td> <font color='#330066' size=3> $row[13] </font></td> \n";
echo "<td> <font color='#330066' size=3> $row[14] </font></td> \n";
echo "<td> <font color='#330066' size=3> $row[15] </font></td> \n";
echo "</tr> \n";
}
echo "</table> \n</center>";
echo "</form>";
?>
<br><br><center><a href="ingreso.php">INSERTAR</a></center>



</body>
</html>[/PHP]
__________________
Josi-Jo :adios: saludos