<?php include('config.php'); try { $dbh = new PDO('mysql:host='. $hostname .';dbname='. $database, $username, $password); } catch(PDOException $e) { echo '<h1>Ha ocurrido un error.</h1><pre>', $e->getMessage() ,'</pre>'; } $sth = $dbh->query('SELECT * FROM scores ORDER BY level ASC LIMIT 15'); $sth->setFetchMode(PDO::FETCH_ASSOC); $result = $sth->fetchAll(); if(count($result) > 0) { echo "TOP 15\n\n"; foreach($result as $r) { echo $r['name'], "\t", "\t", "\t", "\t", "\t", "\t", "Segs.", "\t", $r['score'], "\t", "\t", "\t", "Nivel: \t", $r['level'], "\n\n"; } }?>
SELECT * FROM scores where level=1 ASC LIMIT 15
Simplemente cambia la consulta para hacerla más específica:Código: [Seleccionar]SELECT * FROM scores where level=1 ASC LIMIT 15Saludos.PD: Perfecto por el uso de PDO