Ver Mensaje Individual
  #4 (permalink)  
Antiguo 05/01/2006, 09:52
fed_loco
 
Fecha de Ingreso: julio-2004
Mensajes: 61
Antigüedad: 19 años, 7 meses
Puntos: 0
En primer lugar las etiketas <table> deben estar fuera del while

el while solo debe crear filas no tablas


fijate si ese codigo funciona... puede q me haya comido alguna letra.. o llave.. pero es asi como deberia ser

esperoq te sirva

salu2








//Conexion con la base
mysql_connect("localhost","root","");

//Ejecut0 la sentencia SQL
$result=mysql_db_query("call_center","select * from loterias where fecha like ('$fecha') order by loteria");
?>

<table width="615" align="center" background="../images/fondo.jpg">
<?

//primero verifico si la consulta me devolvio filas
if(mysql_num_rows($result){

//se me devolvio entonces muestro
while ($row=mysql_fetch_array($result))
{
?>
<tr>
<td width="131"><strong><span class="Estilo1 Estilo64 Estilo65"><? echo $row["loteria"] ?></span></strong></td>
<td width="109" class="Estilo1 Estilo31 Estilo63"><? echo $row["hora"] ?></td>
<td width="359"><span class="Estilo66"><? echo $row["a"] ?></span><span class="Estilo66"> - <? echo $row["b"] ?> - </span><span class="Estilo66"><? echo $row["c"] ?></span></td>
</tr>
<?
}
}else{?>
//como no me devolvio nada aviso
<tr>
<td>No hay datos</td>
</tr>
<?}
mysql_free_result($result)
?>
</table>