Ver Mensaje Individual
  #6 (permalink)  
Antiguo 22/10/2011, 23:15
Avatar de MDJProdMusic
MDJProdMusic
 
Fecha de Ingreso: abril-2011
Ubicación: Antofagasta, Chile
Mensajes: 36
Antigüedad: 13 años
Puntos: 0
Respuesta: Crear un top 10

Cita:
Iniciado por Ronruby Ver Mensaje
Usa COUNT, pero agrupa por usuario.

Código MySQL:
Ver original
  1. SELECT COUNT(*) as aportes FROM tabla GROUP BY nombre ORDER BY aportes DESC LIMIT 10;


Ya lo introduje, pero estara bien asi

Código PHP:
 <?
include('/home/michael/public_html/admin/config.php') ;

$pegar "SELECT COUNT(*) nombreremix FROM mremix GROUP BY dj ORDER BY id DESC LIMIT 10;";
    
$cad mysql_db_query($db,$pegar) or die ("Consulta inv&aacute;lida : $sql");
while (
$row mysql_fetch_array($cad)) {
?>

 # <?=$row['dj']?><br />

<?
}
?>
__________________
http://www.chiledj.cl