HI,
Very general query looks like::
Select SOMETHING from SOMEWHERE where SOMETHING_IS_VALID order by SOME_ITEM limit by Some_Number_of_records
Now, we translate htis towards SQL:
$query = "";
means: The variable ($) query will be assigned a value (=) in this case a string (""). End of statement (😉
What do you want to select? : file_name, file_rating
from where? : the table pafiledb_files
What should be valid: Nothing specific at the moment
Order by? : file_rating
THis would give you:
$query = "Select file_name, file_rating from pafiledb_files order by filerating desc limit 0, 10";
To execute the query:
$result = mysql_query($query);
To display some results:
While ( $row = msql_fetch_array($result)
{
echo $row[file_name];
echo $row[file_rating;
echo "<br>";
}
Hope this helps you to get started!?