Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/11/2010, 10:28
gerson_odir
 
Fecha de Ingreso: octubre-2010
Mensajes: 25
Antigüedad: 13 años, 6 meses
Puntos: 0
no se hacer esto ayuda

hola buenas tengo el codigo para hacer una consulta por medio de un campo intrudozco el registro que quiero buscar mi codigo es el siguiente
Código PHP:
<?php
include("config.php");
$conexion=conectarse("gerson","gersongps","gerson");
$rs="SELECT * FROM `gerson`.`geocercas` where Nombre='".$tnombre."'";
$result=mysqli_query($conexion,$rs)or die(mysqli_error());
$num1=mysqli_num_rows($result);
while (
$row=mysqli_fetch_array($result))
{
$rs1="SELECT * FROM units_geofence where geoId='".$row['geoId']."'";
$result1=mysqli_query($conexion,$rs1)or die(mysqli_error());
$num=mysqli_num_rows($result1);
if (
$num>=0)
 {
 while (
$row1=mysqli_fetch_array($result1))
 {
$rs2="SELECT * FROM units where unitid='".$row1['unitid']."'";
$result2=mysqli_query($conexion,$rs2)or die(mysqli_error());

$row2=mysqli_fetch_array($result2);
    
$c++;
  
?>  
  <tr <? if(($c 2)==0){ echo "style='background-color:#D4D3A9;'";}else{echo "style='background-color:#A4A37F;'";} ?>>
    <th bgcolor="" scope="col"><div align="center"><? echo $row1["unitid"?></div></th>
    <th bgcolor="" scope="col"><div align="center"><? echo $row2["vehicle"?></div></th>
    <th bgcolor="" scope="col"><div align="center"><? echo $row["Nombre"?></div></th>
    <th bgcolor="" scope="col"><div align="center"><? echo $row["empresa"?></div></th>
    <th bgcolor="" scope="col"><div align="center"><? echo $row2["last_position"?></div></th>
  </tr>
  <?
  

 }
    }
    
?>

ahora lo que no se es que codigo le falta para que si en caso de que no encuentre el registro me tire un echo diciendo "no se encontro el registro" caso contrario que haga la consulta como es eso???