Well, your statement looks good. Let's see what I can do with it...
fyi, I always write a Connect_To_DB() function to open and return a database connection. (So you don't get confused...)
$select="select name,attendence,count(pts)/count(ptsused) as ratio from some_table
where some_condition=\"some_value\" ";
$connection=Connect_To_DB(); //database connection function
$result=mysql_query($select)
or die("Select from some_table table had errors");
mysql_close($connection);
while ($row=mysql_fetch_array($result,MYSQL_ASSOC))
{
extract($row);
$att_percent=$attendence/$roster_count; //$roster_count is the theoretical max
$penalty=.5-$att_percent;
if ($penalty>0) echo "Ratio for $name is " . $ratio-$penalty . "<br />";
else echo "Ratio for $name is $ratio <br />"
}
How's that grab ya?