Good evening
I'm looking for yet more assistance, and hope someone is able to point me in the right direction.
I'm trying to produce a format for our tipping competition, whereby people who fail to complete their entries are shown a) without a result in the profit column, and b) are highlighted with a grey background. I have attempted to write the code, but it's not producing the right effect:
<?php
$query = " SELECT SUM(comptipsterselections.profit) as Profit, comptipsterselections.stable, comptipsterboard.link
FROM comptipsterselections INNER JOIN comptipsterboard
ON comptipsterselections.stable=comptipsterboard.stable
AND comptipsterselections.comp=comptipsterboard.comp
WHERE comptipsterselections.comp = 'aintree 2011'
GROUP BY comptipsterselections.stable, comptipsterboard.link
ORDER BY SUM(comptipsterselections.profit) DESC";
$result = mysql_query($query) or die(mysql_error());
// Set-up table
echo "<table class='english' border='1' cellpadding='4' cellspacing='0' width='75%'>";
echo "<tr class='toprow'> <th>Stable</th> <th>Daily Profit</th></tr>";
// Print out result
while($row = mysql_fetch_array($result)){
$link='/site/competitions/tipster'.$row[link];
if ($row[completed] == 'no') {
echo "<tr><td bgcolor='#C0C0C0'>";
echo "<a href='$link'>";
echo $row[stable];
echo "</td><td bgcolor='#C0C0C0'>";
echo "";
echo "</td></tr>";
}
else
{
echo "<tr><td>";
echo "<a href='$link'>";
echo $row[stable];
echo "</td><td>";
echo " £". $row[Profit];
}
echo "</td></tr>";
}
echo "</table>";?>
Any assistance in getting the right effect would be very much appreciated.