Estoy trantado de hacer lo siguiente :
Que me muestre todo un contenido siempre y cuando haya un registro en mi base de datos caso contrario que salga algun mensaje, yo tengo lo siguiente pero no se si estara bien structurado
Código PHP:
<?
$sql = "Select * from servicios where idservicio = '' ";
$datos = ''; //como debo de hacer k esta variable capte algun registro de mi tabla
?>
<?php if ($datos != '') { ?>
<table width="450" border="1">
<tr>
<td> </td>
</tr>
<tr>
<td><img src="../imagenes/mensajes/br.gif" width="21" height="20"><img src="../imagenes/admin/login.gif" width="64" height="16"></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</table>
<?php
} else {
// esto se debe de mostar en caso k no tenga ningun registro en mi B.D.
?>
<table width="450" border="1">
<tr>
<td>No hay datos disponibles por el momento </td>
</tr>
</table>
<?
}
?>