I'm trying to list the top highest 10 values in my MySQL table.
I've tried this:
$SQL = ("SELECT * Rating FROM download_manager ORDER BY Rating DESC LIMIT 10;");
$results = mysqli_query($SQL);
var_dump($results);
However that returns a NULL, also I'd need it to echo back two rows and not the whole table...
DB Structure: id | filename | downloads
I need to just echo back the top 10 highest downloads and the associated filename.
Update:
Rating is not the table, connection is done through a require connect. I've removed the () however still get a null.
Try that
$SQL = "SELECT Rating FROM download_manager ORDER BY Rating DESC LIMIT 10;";
$results = mysqli_query($SQL);
var_dump($results);