$rides = new RDride(DBconnect(), $units);
$result = $rides->queryRides($currentQuery->getWhereStatement(), $start, $num + 1);
$totalTime = 0;
$totalDist = 0;
$numRides = 0;
//Not really num rides, used to see if more data is available.
while ($rides->parseNextRow($result)) {
    $numRides++;
    if ($numRides > $num) {
        break;
    }
    echo "<TR>";
    echo "<TD class=\"tbLogBody\">" . "<a href=\"showRide.php";
    $tgetvars = $getVars;
    $tgetvars["rideID"] = $rides->f_rideID;
    echo encodeGet($tgetvars) . "\">" . $rides->getDatePart() . " " . $rides->getTimePart() . "</a>&nbsp;" . "<img width='10' height='16' src=\"" . getImgForTemp($rides->f_temperature, $units) . "\">" . "<img width='25' height='16' src=\"s" . $rides->f_sky . ".png\">" . "<img width='16' height='16' src=\"w" . $rides->f_wind . ".png\">" . "</TD>";
    echo "<TD class=\"tbLogBody\">" . fixFieldForHTML($rides->f_riderID_firstName . " " . $rides->f_riderID_lastName, 0) . "</TD>";
    echo "<TD class=\"tbLogBody\">" . "<img width='16' height='16' src=\"" . "templates/" . $RD_template . "/loc" . locationTypeToNumber($rides->f_locationID_type) . ".png\">&nbsp; " . fixFieldForHTML($rides->f_locationID_location, 0) . "</TD>";
    echo "<TD class=\"tbLogBody\">" . number_format($rides->f_distance, 2) . "</TD>";
    echo "<TD class=\"tbLogBody\">{$rides->f_time}</TD>";
    echo "<TD class=\"tbLogBody\">" . number_format($rides->c_avgSpeed, 2) . "</TD>";
    echo "<TD class=\"tbLogBody\">{$rides->f_effortLevel}</TD>";
    echo "</TR>\n";
    echo "<TR>";
    echo "<TD class=\"tbLogBody2\" colspan='7'>" . fixFieldForHTML(firstLine($rides->f_notes, 70), 0) . "&nbsp;</TD>" . "</TR>\n";
    $totalTime += $rides->f_timeSecs;
    $totalDist += $rides->f_distance;
}
echo "<TR>";
echo "<TD class=\"tbLogFootHead\"><b>Sum/Avg/Max of Displayed:</b></TD>";
echo "<TD class=\"tbLogFoot\">&nbsp;</TD>";
</td>
                 <td class="tbLogHeader">Avg Speed</td>
                     <td class="tbLogBody"><?php 
echo number_format($ride->c_avgSpeed, 2) . " " . $units->velocityString();
?>
</td>
                   </tr>
                   <tr>
                 <td class="tbLogHeader">Effort</td>
                     <td class="tbLogBody"><?php 
echo $ride->f_effortLevel;
?>
</td>
                 <td class="tbLogHeader">Temp</td>
                     <td class="tbLogBody"><?php 
echo "<img width='10' height='16' src=\"" . getImgForTemp($ride->f_temperature, $units) . "\">&nbsp; " . number_format($ride->f_temperature, 1) . $units->tempString();
?>
</td>
                   </tr>
                   <tr>
                 <td class="tbLogHeader">Wind</td>
                     <td class="tbLogBody"><?php 
echo "<img width='16' height='16' src=\"w" . $ride->f_wind . ".png\">&nbsp; " . $ride->f_wind;
?>
</td>
                 <td class="tbLogHeader">Sky</td>
                     <td class="tbLogBody"><?php 
echo "<img width='25' height='16' src=\"s" . $ride->f_sky . ".png\">&nbsp; " . $ride->f_sky;
?>
</td>
                   </tr>