Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/10/2009, 18:05
Avatar de luis010182
luis010182
 
Fecha de Ingreso: julio-2009
Ubicación: Argentina - Capital Federal
Mensajes: 382
Antigüedad: 15 años, 8 meses
Puntos: 27
Respuesta: Ayuda para una consulta

Código PHP:
<html>
<head>
</head>
<body>
<tabla>
<tr><th>Titulo1</th><th>Titulo2</th><tr>
<?
include "conexion.php";
$result=mysql_query("SELECT COUNT(photo_download) FROM `Tabla_Imagenes` WHERE `photo_download`>0",$conexion)or die (mysql_error());
#cuento las filas
$num_rows mysql_num_rows($tmp);

#si hay filas
if($num_rows){        

    while(
$row mysql_fetch_array($tmpMYSQL_ASSOC)){

        
?><tr><td><?=$row['campo1']?></td><td><?=$row['campo2']?></td><tr><?
    
}

}

#si no hay filas
else{

    
?><tr><td colspan=2>no hay resultado</th><tr><?
}

 

include 
"cerrar_conexion.php";
?> 
</table>
</body>
</html>
Espero que te sirva.