Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    May 2011
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Help! Remove underline from mysql text!

    Hi guys.

    Need some help please!

    I have a table that has data from mysql in it. I have managed to get the text in the rows to hyperlink, but want to remove the underline.... Ideally I would like it to come back when hover on mouse. Can anyone help me? I tried style=decoration: none etc but to no avail as its text from mysql and not the actual webpage. Here is my code so far. Note the style attributes work on text on the page but not on the text that is in the mysql database.


    Code:
    <?php
    $con = mysql_connect("host","dbase","password");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("a5525005_cars", $con);
    
    $result = mysql_query("SELECT * FROM `cars` ORDER BY Location");
    
    echo "<table border='0'>
    <tr style=font-family:verdana;font-size:110%;color:red;>
    <th>Photo</th>
    <th>Location</th>
    <th>Model</th>
    <th>Price</th>
    </tr>";
    while($row = mysql_fetch_array($result))
      {
      echo "<tr style=font-family:verdana;font-size:150%;color:blue;style='text-decoration:none'>";
      
        echo "<td>" . $row[""] . "<img src=\"" . $row["Photo"] . "\"></a>";
        echo "<td><a href=\"" . $row['URL'] . "\">" . $row['Location'] ."</a></td>";
        echo "<td><a href=\"" . $row['URL'] . "\">" . $row['Model'] . "</a></td>";
        echo "<td><a href=\"" . $row['URL'] . "\">" . $row['Price'] . "</a></td>";
       
    echo "</tr>";
      }
    echo "</table>";
    mysql_close($con);
    ?>

  • #2
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,332
    Thanks
    5
    Thanked 363 Times in 360 Posts
    You're missing a semi colon after the word none;

    Actually no I'm wrong.
    Teed

  • #3
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,662
    Thanks
    41
    Thanked 189 Times in 188 Posts
    EDIT: oops, never-mind... had wrong info before :

    Code:
    a:link {text-decoration: none;} 
    a:visited {text-decoration: none;} 
    a:hover {text-decoration: underline;}
    but i did a quick search and found another forum where they were talking about modifying similar issue (changin color which would be along same lines) and referred to javascript needed to handle it...
    Last edited by alykins; 05-28-2011 at 12:15 AM. Reason: wrong info

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #4
    New Coder
    Join Date
    May 2011
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks for replies. As i a new to the coding scene (basically work off trial and error) where would i need to place this code???

    Thanks again

  • #5
    New Coder
    Join Date
    May 2011
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks guys, got it working.

    Much appreciated!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •