Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

font colours!! (ARRH)

Codes here !

Moderators: macek, egami, gesf

font colours!! (ARRH)

Postby php-punk » Tue Jul 08, 2003 9:48 am

rite i have made a website and i created the links page, no problems untill i want to display the description pulled from a DB, the font colours of the description are baclk (but so is the background): CODE:

Code: Select all

<?

if(!session_id())
{

session_start();

session_register("user");

}
?>

<html>
<head>
</head>
<body bgcolor="#000000">
<center><iframe frameborder=0 src="http://to-j.com/ad2.htm" width="120"
height="60" target="_blank" scrolling="no"> </iframe></center>


<table border="1" bordercolordark="#FFFFFF" bordercolorlight="#FFFFFF" bordercolor="#FFFFFF">
<tr><td><p><img src="images/logo.png" width="400" height="100"></p>
      <a href="index.php"><img src="images/news-button.png" width="180" height="49" border="0"></a><a href="reviews.php"><img src="images/reviews-button.png" width="180" height="49" border="0"></a><a href="feat.php"><img src="images/featured-button.png" width="180" height="49" border="0"></a><a href="profiles.php"><img src="images/profiles-button.png" width="180" height="49" border="0"></a><a href="feat.php"></a><a href="mailto:sk8rstu@hotmail.com?Subject=Punk-Style"><img src="images/contact-button.png" width="180" height="49" border="0"></a><a href="http://punk-style.to-j.com/forum/phpBB2/"><img src="images/forums-button.png" width="180" height="49" border="0"></a><a href="/links.php"><img src="images/Links-button.png" width="184" height="49" border="0"></a></p>
      <p>&</p>
      <p>
        <?PHP


$session = session_id();

$c = mysql_connect(localhost,"","") or die ("<font color=\"#FF00FF\">sorry unable to connect to database".mysql_error()."</font>");

$db = mysql_select_db(punk_style_to_j_com,$c) or die ("<font color=\"#FF00FF\">sorry unable to connect to database".mysql_error()."</font>");

$query = "SELECT * FROM links";

$result = mysql_query($query) or die ("<font color=\"#FF00FF\">sorry unable to connect to database".mysql_error()."</font>");

echo("<font color=\"#FFFFFF\" face=\"Geneva, Arial, Helvetica, san-serif\"><b>Links</b></font>");

while ($row = mysql_fetch_array($result))
{
   echo(" ");
   echo("<p align=\"center\">");
   echo("<table celpadding=\"1\" cellspacing=\"1\">");

      
      echo("<tr>");
      echo("<td align=\"center\"> <font color=\"#FFFFFF\">"."<a href='".$row["link"]."'>".$row["link"]."</a></font></td>".$row["description"]." </font> </TD>");
      echo("</tr>");
      echo("</table>");
   echo("<p>");
}
   
   
   mysql_free_result($result);
?>
    </td></tr>
</table>
</p>
<p><font color="#FFFFFF">All material is & Punk-Style 2003, All images are
  of Break the boarder are © Break The Boarder 2003. All images that are not
  of Break The Boarder are © there respective owners. All Band names are &
  there respective owners</font></p>
<p> <a href="login/logout.php">logout</a> </p>
</body>
</html>


Any help greatly appreciated
php-punk
New php-forum User
New php-forum User
 
Posts: 60
Joined: Sun Feb 02, 2003 2:10 am
Location: Leeds, Uk

Postby Joan Garnet » Tue Jul 08, 2003 11:38 am

There were some syntax errors and something more...
This was the only piece of code that you should had posted :wink: and next time try to post in the right forum, this is about Mysql + php code. Just to keep forums tidy.

Code: Select all
while ($row = mysql_fetch_array($result))
{
   
   echo " <p align='center'>";
   echo "<table cellpadding=1 cellspacing=1>";
   echo "<tr>";
   echo "<td align='center'>
         <font color='#FFFFFF'>
             <a href='".$row["link"]."'>".$row["link"]."</a>
         </font>
       </td></tr>
       <tr><td>      
         <font color='#FFFFFF'>
            ".$row["description"]."
         </font>
       </td></tr></table>";
}
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Postby php-punk » Wed Jul 09, 2003 10:58 am

sorry my mistake , thanks by the way!! but i wasn't sure if to post in here or elsewhere, as it is regarding a sql thing!
php-punk
New php-forum User
New php-forum User
 
Posts: 60
Joined: Sun Feb 02, 2003 2:10 am
Location: Leeds, Uk


Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 5 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.