View Full Version : Help! Remove underline from mysql text!

05-28-2011, 12:34 AM
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.

$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;>
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>";

05-28-2011, 01:03 AM
You're missing a semi colon after the word none;

Actually no I'm wrong.

05-28-2011, 01:06 AM
EDIT: oops, never-mind... had wrong info before :

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...

05-28-2011, 12:56 PM
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

05-28-2011, 01:09 PM
Thanks guys, got it working.

Much appreciated!