Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/09/2012, 09:34
ninco90
 
Fecha de Ingreso: enero-2011
Mensajes: 77
Antigüedad: 13 años, 3 meses
Puntos: 3
Respuesta: Texto si no hay resultados en Base de Datos

Solucionado!!

Código PHP:
Ver original
  1. <?php
  2. $query2 = "SELECT * FROM empresa WHERE `usuario` = '$username' ORDER BY id desc";
  3. $queEmp2 = mysql_query($query2, $conexion) or die (mysql_error());
  4. if (mysql_num_rows($queEmp2)> 0)
  5. { ?>
  6. <table width="95%" class="table table-striped" border="0" align="left" cellpadding="0" cellspacing="0">
  7.   <thead> <tr>
  8.     <td width="15%"></td>
  9.      <td width="28%"><h2>Nombre</h2></td>
  10.     <td width="40%"><h2>Descripción</h2></td>
  11.     <td width="28%"><h2>Categoría</h2></td>
  12.   </tr> </thead>
  13.   <tbody><?php while ($rsEmp = mysql_fetch_assoc($queEmp2)) { ?>
  14.   <tr>
  15.     <td><img src="https://i4.ytimg.com/vi/<?php echo $rsEmp['contenido']; ?>/mqdefault.jpg" width="120px" height="70px" alt="Carrátula"></td>
  16.     <td><strong><a href="ver.php?id=<?php echo $rsEmp['id']; ?>"><?php echo $rsEmp['nombre']; ?></a></strong><br> Por: <?php echo $rsEmp['usuario']; ?></td>
  17.     <td><?php echo $rsEmp['descripcion']; ?></td>
  18.     <td><span class="label label-success"><?php echo $rsEmp['tipo']; ?></span></td>
  19.   </tr>
  20.   <?php } ?></tbody>
  21. </table>
  22.  
  23. <?php } else {
  24. echo("No Existen registros");
  25. }
  26. ?>