I have a table with the following:
6xx 8xx 9xx 11xx 12xx
1 0.01 0.002 0.004 0.001 0.025
2 0.025 0.125 0.002 0.01 0.011
I would like to find the Smallest Value from the column make that column to be green color.
For example in 1st the smallest value is 0.001 so i want it to be green color, for second 0.002 is smallest value i want it to be green color.
can any one guide me how to make this ,thanks
below is the code how i selecting it from database and displaying int in a table
<?php
$dbHost = 'localhost'; // usually localhost
$dbUsername = 'xxxx';
$dbPassword = 'xxxx';
$dbDatabase = 'xxxx';
$db = mysql_connect($dbHost, $dbUsername, $dbPassword) or die ("Unable to connect to Database Server.");
mysql_select_db ($dbDatabase, $db) or die ("Could not select database.");
$ColumnNames = mysql_query("SELECT column_name
FROM information_schema.COLUMNS
WHERE table_name = 'supplierprice'
AND column_name NOT IN ('supp_price_id',
'region',
'country',
'net_id',
'networkname',
'mcc',
'mnc',
'mnp')")
or die("mysql error");
$columnArray=array();
$i=0;
while($rows=mysql_fetch_array($ColumnNames))
{
$columnArray[]=$rows[0];
echo "<th style='width:67px;' class='. $columnArray[$i] .' >" . $columnArray[$i] . "
</th>";
$i++;
}
?>
foreach($columnArray as $value) {
//$columnArray[]=$rows1[0];
echo '<td style="width:67px;font-weight:'.$text.'" id="CPH_GridView1_xxx" width="0px;" class="'.$value.' '.$rows["net_id"].'"><p>'.$rows[$value].'</p></td>';
}