Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/04/2008, 21:24
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 8 meses
Puntos: 2135
Re: no consigo hacer un IF

Prueba así:
Código PHP:
<?php require_once('Connections/seleccion.php');
mysql_select_db($database_seleccion$seleccion) or die(mysql_error());
$hoy=date("Y-m-j h:i:s");
$sql=mysql_query("SELECT * FROM registro WHERE DATEDIFF('$hoy',fecha) <=1",$seleccion) or die( mysql_error() );
$num mysql_num_rows$sql );
if (
$num ) {while ($row=mysql_fetch_array($sql)) {?>
<table><tr>
<td width="74">Nombre:</td>
<td width="198"><?php echo $row['nombre'];?></td>
</tr>
<tr><td>Fecha:</td><td><?php echo $row['fecha'];?></td></tr>
<tr><td>Mail:</td><td><?php echo $row['mail'];?></td></tr>
<tr>
  <td valign="top" bgcolor="#CCFFCC">Comentario:</td>
  <td bgcolor="#CCFFCC"><?php echo $row['comentarios'];?></td>
</tr>
<tr>
  <td colspan="2" valign="top"><hr size="3"></td>
  </tr>
</table>

<?php }}
else {echo
'no existen nuevos registros';}

?>
Saludos.