I have been working on trying to teach myself programming and have come stuck on a simple problem ,
the line I am working with is
echo "<td>" . $row['website'] . "</td>";
only in the database {mysql} it is in plain text under the column 'website' , I have been trying to work out how to make the row website clickable for the whole table,
i have tried <href ="echo "<td>" . $row['website'] . "</td>"";
I have tried searching the web for an answer , only i dont seem to be able to phrase the question for the right results.
thank you .
I also tried
<?
$result = mysql_query("SELECT * FROM leader");
echo "<table border='1'> <tr> <th>id</th> <th>Club</th> <th>Website</th> <th>Club Badge</th> </tr>";
while($row = mysql_fetch_array($result)) {
echo "<tr>"."<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['club'] . "</td>";
echo "<td>" . $row['website' ] . "</td>";
echo "<td><a class=\"mylink\" href=\"" . $row['website'] . "\">" . $row['website'] . "</a></td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
but still got Parse error: syntax error, unexpected '<' in /home/a6332763/public_html/res.php on line 29
UPDATE......... Have now got link to show in right box only its adding the sites url in-front of the links url, here is the code , minus mysqul connection .
<?php
$result = mysql_query("SELECT * FROM leader");
echo "<table border='1'>
<tr>
<th>id</th>
<th>Club</th>
<th>Website</th>
<th>Club Badge Url</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>"."<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['club'] . "</td>";
echo "<td><a class=\"mylink\" href=\"" . $row['website'] . "\">" . $row['website'] . "</a></td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
<html>
<body>
<a href="res.php">Link text</a>
Click on <a href="http://www.sumsitehere.com">this link</a> to run your first PHP script.
</body>
</html>