Not echoing result, I think because result is a sum and not a specific entry in the db?
<?PHP
error_reporting('E_ALL');
include('session.php');
include('config.php');
$sql="SELECT SUM(grading) FROM (SELECT * FROM 'trails' WHERE `name` = 'Free Flow' ORDER BY `id` DESC LIMIT 5) AS DATA";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)) {
echo $row['grading'];
}
?>
Updated version giving lank page...
<?PHP
error_reporting(E_ALL);
include('session.php');
include('config.php');
$sql="SELECT SUM(grading) AS grading FROM (SELECT * FROM `trails` WHERE `name` = "Free Flow" ORDER BY `id` DESC LIMIT 5) AS DATA";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result)) {
echo $row['grading'];
}
?>