Gradient (based on the number of records)
Posted: Sun Jun 08, 2008 8:01 pm
Please visit this url to get a preview of what i'm trying to accomplish:
http://classes.design.ucla.edu/Spring08 ... /index.php
To make that gradient dynamic this is the code im working on:
Does that For Loop right?
I need that For Loop to count down in the rgb space. How can this be done?
http://classes.design.ucla.edu/Spring08 ... /index.php
To make that gradient dynamic this is the code im working on:
Code: Select all
$sql = "SELECT * FROM playlist ORDER BY DT DESC";
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
[b]for ( $i = $num_rows; $i < $num_rows + 1 && $i > 0; $i++) {
$rgb = 255-(230/$i);
} [/b]
Code: Select all
<div id="media">
<ul>
<?php
$sql = "SELECT * FROM playlist ORDER BY DT DESC";
$result = mysql_query($sql);
while ( $row = mysql_fetch_assoc($result) ) {
echo "<li><a href='#'><font style='color:rgb(255,255,255);'>{$row['title']}</font></a></li>";
}
?>
</ul>
</div>
</div>