Ver Mensaje Individual
  #4 (permalink)  
Antiguo 25/03/2011, 04:11
jokin82
 
Fecha de Ingreso: octubre-2005
Mensajes: 42
Antigüedad: 18 años, 6 meses
Puntos: 0
Respuesta: Contar registros sin importar el select distinct

Solucionado.

Lo pongo por si a alguien le pudiera servir:

Código:
$sql = "select distinct city from sho where city like 'M%'";
$sql2 = "select city from accommodation where city like 'M%'";
$result = mysql_query($sql,$db_con);
$total = mysql_num_rows($result);
$count = mysql_query($sql2);
while(($row = mysql_fetch_array($result)) && ($total = mysql_num_rows($count)))
{ 
echo '<tr>
<td><a href=rest.php?city='.urlencode($row["city"]).'>'.$row["city"].'</a> <em><strong>'.$total.'</strong></em></td>
</tr>';
}
mysql_free_result($result);
?>
__________________
- Productos islandeses desde Islandia
- News from Spain in English Spain news