phpfisher Posted November 29, 2006 Share Posted November 29, 2006 [code]<head><?php include_once("header.php")?><?php include("db.php")?><title><?php echo $cfg["name"];?></title></head><body><?php // Get all the data from the " pp_files" table$result = mysql_query("SELECT * FROM pp_files") or die(mysql_error()); echo "<center><table border='0' width='50%'>";// keeps getting the next row until there are no more to getwhile($row = mysql_fetch_array($result)){ echo "<tr>"; echo "<td bgcolor='#C0C0C0'>"; echo "<a href='videos.php?id=".$row[id]."'>"; echo "<font color='#00000' '><strong>".$row['name']."</strong><br>"; echo $row['description']."<br>"; echo $row['date']."<br>"; echo $row['creator']."<br></font>"; echo "</tr>";}echo "</table>";echo "</center>"; ?><?php include("footer.php")?></body></html>[/code][code] echo "<td bgcolor='#C0C0C0'>";[/code]basically i want to change this colour to #CCCCCC every rowalso there is a gap between each one can you remove it Quote Link to comment Share on other sites More sharing options...
brown2005 Posted November 29, 2006 Share Posted November 29, 2006 the gaps come from the <br> so u need to remove them Quote Link to comment Share on other sites More sharing options...
phpfisher Posted November 29, 2006 Author Share Posted November 29, 2006 [code]echo $row['creator']."</font>";[/code]i removed that it didnt do anything Quote Link to comment Share on other sites More sharing options...
taith Posted November 29, 2006 Share Posted November 29, 2006 [code]<head><?include_once("header.php")?><?include("db.php")?><title><?=$cfg["name"];?></title></head><body><?php // Get all the data from the " pp_files" table$result = mysql_query("SELECT * FROM pp_files") or die(mysql_error()); echo "<center><table border='0' width='50%'>";// keeps getting the next row until there are no more to getwhile($row = mysql_fetch_array($result)){ if($i==0){ $i=1; $class='#C0C0C0'; }else{ $i=0; $class='#CCCCCC'; } echo "<tr>"; echo "<td bgcolor='$class'>"; echo "<a href='videos.php?id=".$row[id]."'>"; echo "<font color='#00000' '><strong>".$row['name']."</strong><br>"; echo $row['description']."<br>"; echo $row['date']."<br>"; echo $row['creator']."<br></font>"; echo "</tr>";}echo "</table>";echo "</center>"; ?><?include("footer.php")?></body></html>[/code] Quote Link to comment Share on other sites More sharing options...
trq Posted November 29, 2006 Share Posted November 29, 2006 This question is asked every second day by someone who doesn't know how to search the board. So common is this question that a solution has been posted in the sticky [url=http://www.phpfreaks.com/forums/index.php/board,41.0.html]code snippet / repository[/url] thread. Quote Link to comment Share on other sites More sharing options...
phpfisher Posted November 29, 2006 Author Share Posted November 29, 2006 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.