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 7 of 7
  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
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts

  • #3
    New Coder
    Join Date
    May 2011
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks for reply,

    I am new to coding and tried the content on this page but no joy. All the text disappears?

    Could you inform me to where I should be placing this text within my code...

    Thanks again

  • #4
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,327
    Thanks
    60
    Thanked 525 Times in 512 Posts
    Blog Entries
    4
    Try asking in the html / css forum.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • Users who have thanked tangoforce for this post:

    amg182 (05-28-2011)

  • #5
    New to the CF scene
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Use text-decoration in style

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    This has nothing to do with PHP. The underline is a result of the style in use, which is a part of the client rendering not PHP. If it were underscores, that would be a data issue PHP could deal with.
    I believe text decorations on anchors need to be out of pseudo classes :link, :visited, :active, :hover. I don't think it can just be applied to the 'a', but a quick test will tell you if you can get away with that.

  • #7
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Closing thread; duplicate post to continue discussion located here: Help! Remove underline from mysql text!


  •  

    Tags for this Thread

    Posting Permissions

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