tsinka wrote:You nearly posted the code. I think something like this (simplified) should do it. Assuming that the code is inside a loop that prints the table rows.
// inside a while loop
$strStyle = '';
if ($name == "Four Marks Football Club") {
$strStyle = ' style="font-weight:bold;color:yellow;"';
}
echo "<tr{$strStyle}>\n";
Thomas
So where abouts would I put it in the following code?
<?php
$conn = @mysql_connect( "$dbHostname", "$dbUsername", "$dbPassword" )
or die( "Could not connect" );
$rs = @mysql_select_db( "fourmarks1", $conn )
or die( "Could not select database" );
$sql = "select * from 1stTable0607 order by position";
$rs = mysql_query( $sql, $conn )
or die( "Could not execute query" );
$list = "<table style=\"width:520px\" cellpadding=\"2\">";
$list .= "<tr><th style=\"width:5%\"> </th>";
$list .= "<th style=\"width:45%\"> </th>";
$list .= "<th style=\"width:6%\">p</th>";
$list .= "<th style=\"width:6%\">w</th>";
$list .= "<th style=\"width:6%\">d</th>";
$list .= "<th style=\"width:6%\">l</th>";
$list .= "<th style=\"width:6%\">f</th>";
$list .= "<th style=\"width:6%\">a</th>";
$list .= "<th style=\"width:7%\">gd</th>";
$list .= "<th style=\"width:7%\">pts</th>";
while( $row = mysql_fetch_array( $rs ) )
{
$list .= "<tr>";
$list .= "<td>".$row["position"]."</td>";
$list .= "<td>".$row["team"]."</td>";
$list .= "<td>".$row["p"]."</td>";
$list .= "<td>".$row["w"]."</td>";
$list .= "<td>".$row["d"]."</td>";
$list .= "<td>".$row["l"]."</td>";
$list .= "<td>".$row["f"]."</td>";
$list .= "<td>".$row["a"]."</td>";
$list .= "<td>".$row["gd"]."</td>";
$list .= "<td>".$row["pts"]."</td>";
$list .= "</tr>";
}
$list .= "</table>";
echo( $list );
?>
Thanks.