
15/02/2006, 10:17
|
| | Fecha de Ingreso: febrero-2004
Mensajes: 65
Antigüedad: 21 años Puntos: 0 | |
Problema con Select Perfecto, este es el archivo que se genera .php
pero tengo una duda
al ejecutar la consulta, me trae una fila, por cada ciudad seleccionada
ej.
Cantidad de filas: 3
------------------------------------------
FECHA Y HORA DE EMISION
2006-02-15
12:43:00 HOA
POR OCURRENCIA DE:Lluvias Intensas con Ráfagas
AREA AFECTADA DELIMITADA POR : 25 de Mayo
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FECHA Y HORA DE EMISION
2006-02-15
12:43:00 HOA
POR OCURRENCIA DE:Lluvias Intensas con Ráfagas
AREA AFECTADA DELIMITADA POR : 9 de Julio
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FECHA Y HORA DE EMISION
2006-02-15
12:43:00 HOA
POR OCURRENCIA DE:Lluvias Intensas con Ráfagas
AREA AFECTADA DELIMITADA POR : Acebal
------------------------------------------
yo lo que quiero es que me traiga 1 solo registro, dependiendo la
cantidad de ciudades elegidas,
que me muestre 1 registro con x cantidad de ciudades dependiendo
de la hora.. por ejemplo
--------------------------------------------------
FECHA Y HORA DE EMISION
2006-02-15
12:43:00 HOA
POR OCURRENCIA DE:Lluvias Intensas con Ráfagas
AREA AFECTADA DELIMITADA POR : 25 de mayo,9 de Julio, Acebal.
---------------------------------------------------
FECHA Y HORA DE EMISION
2006-02-15
13:00:00 HOA
POR OCURRENCIA DE:Lluvias Intensas con Ráfagas
AREA AFECTADA DELIMITADA POR : Rawson
---------------------------------------------------
$consulta = "SELECT * FROM
TAviso a INNER JOIN (TAvisoSeleccion b, TAvisoOcurrencia c,TAvisoCiudad d)
ON (a.IdAlerta = b.IdAlerta AND a.IdOcurrencia=c.IdOcurrencia AND d.IdCiudadAlerta = b.IdCiudadAlerta)
WHERE a.Hora<'$actualmastres'";
$resaviso = mysql_query($consulta,$conex);
if ($resaviso)
{
$Num_filas = mysql_num_rows($resaviso);
$Num_campos = mysql_num_fields($resaviso);
echo "Cantidad de filas: ".$Num_filas."<br>";
//echo "Cantidad de Campos: ".$Num_campos."<br>";
while ($fila = mysql_fetch_array($resaviso))
{
?>
<table width='85%' border='1'>
<tr>
<td><div align='center'><strong>FECHA Y HORA DE EMISION</strong></div></td>
<td><div align='center'><strong>VALIDEZ HASTA</strong></div></td>
</tr>
<tr>
<td><div align='center'><? echo $fila['Fecha']; ?></div></td>
<td> TRES (3) HORAS. posteriores a la emision</td>
</tr>
<tr>
<td><div align='center'><? echo $fila['Hora']; ?> HOA</div></td>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align='left'><b>POR OCURRENCIA DE:</b><? echo $fila['DescOcurrencia']; ?></div></td>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align='left'><b>AREA AFECTADA DELIMITADA POR :</b> <? echo $fila['NomCiudad']; ?>
</div></td><td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><p><b>---------------------------------------------------------------------------------------------------------------------------------------------------------------</b>-------------------------
</p>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<?
} //cierra while
} //cierra if
otra pregunta ....y solo quiero que me muestre las del dia de hoy.. pero que pasa si
se genera un aviso a las 23:00 ??
se entiende?? |