Jump to content

anyone think they can do this!!!


phpfisher

Recommended Posts

[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 get
while($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 row

also there is a gap between each one can you remove it
Link to comment
Share on other sites

[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 get
while($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]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.