I have a table called articles, each article has a rating value. I want to select * from the ten articles with the highest rating.
something along these lines
$query = "SELECT TOP 10 rating FROM articles ORDER BY rating DESC";
I am confused about the TOP 10 part, I would usualy have SELECT * FROM
Use LIMIT to do this
$query = "SELECT * FROM articles ORDER BY rating DESC LIMIT 10";
Documentation here
you can do so by folloing SQL Query
SELECT * FROM article ORDER BY rating DECS LIMIT 10;