No va mira, te pongo otro ejemplo
Quiero que esta tabla no se vea si no hay alguna noticia,
la base de datos es SQL recoge bien los datos y todo va bien pero
cuando no hay ningun registro se ve la tabla y yo no quiero que se vea.
Codigo de tabla:
Cita: <table width="51%" border="0" align="center">
<tr bgcolor="#EDD589">
<td height="24" colspan="2" valign="top" bgcolor="#FF9999" class="centro32"><span class="doce">Noticias:</span></td>
</tr>
<?php if ($totalRows_noticias > 0) { // Show if recordset not empty ?>
<?php do { ?>
<tr bgcolor="#EDD589">
<td width="67%" height="36" align="left" valign="top" bgcolor="#FFCCCC" class="centro32"><span class="negro"><strong>Titular:</strong></span><span class="doce"><strong>
<?php
echo $row_noticias['titular'];?>
<?php if(($_SESSION['MM_UserGroup']=="admin") ){ ?>
<a href="editar_noticias.php?noticia_id=<?php echo $row_noticias['noticia_id']; ?>">Editar</a><span class="negro11">
<?php } ?>
<span class="doce4"><strong><a href="eliminar_noticia.php?noticia_id=<?php echo $row_noticias['noticia_id']; ?>" class="doce"><em>Eliminar</em></a></strong></span> </span><br />
Texto:</strong><?php echo nl2br($row_noticias['texto']);
?> <br />
</span></td>
<td width="33%" align="left" valign="top" bgcolor="#FFCCCC" class="centro32"><span class="doce3"><strong><img src="imagen/<?php echo $row_noticias['imagen']; ?>" width="58" height="54" /><br />
<br />
<strong><strong class="doce5"><strong><?php echo $row_noticias['fecha']; ?></strong></strong></strong><br />
</strong></span></td>
</tr>
<?php } while ($row_noticias = mysql_fetch_assoc($noticias)); ?>
<?php } // Show if recordset not empty ?>
</table>