Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/10/2013, 09:21
sarrhen
 
Fecha de Ingreso: mayo-2013
Ubicación: San Vicente
Mensajes: 127
Antigüedad: 11 años
Puntos: 1
Busqueda Necesito colocar un mensaje que me diga que no se encontraron datos

Tengo el siguiente codigo pero he intendado colocar un mensaje pero este me sale antes y lo que necesito es que lo muestre cuando se haya digitado el numero de identificacion y este no sea igual en la base de datos
<?php
require("conexion.php");
require("funciones.php");

$criterio = getParam($_GET["criterio"], "");
$total = 0;
if ($criterio != "") {
$query = "SELECT * FROM Actualizacion WHERE DUI = $criterio";
$queEmp = mysql_query($query, $conexion);
$total = mysql_num_rows($queEmp);
}
else{
echo "<br> No se encontraron datos para <b>".$criterio."</b>";
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>PHP con MySQL: Consultar datos en MySQL</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h3>Buscador de Empresas</h3>
<form id="frbuscar" name="frbuscar" method="get" action="">
<input name="criterio" type="text" id="criterio" size="25" value="<?php echo $criterio; ?>" /> &nbsp;
<input type="submit" id="btbuscar" value="Buscar" />
</form>
<?php if ($total > 0) { ?>
<p><em>Total de Resultados: <?php echo $total; ?></em></p>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>NombreCompleto</th>
<th>Codigo de Cliente</th>
<th>NIT</th>
<th>DUI</th>
</tr>
<?php while ($rsCliente = mysql_fetch_assoc($queEmp)) { ?>
<tr>
<td><?php echo $rsCliente['nombresCompleto']; ?></td>
<td><?php echo $rsCliente['cod_Cliente']; ?></td>
<td><?php echo $rsCliente['NIT']; ?></td>
<td><?php echo $rsCliente['DUI']; ?></td>
</tr>
<?php } ?>
</table>
<?php } ?>
<p>&nbsp;</p>
</body>
</html>