I'm working on a page that shows results from my database, it show in a page the website url and club name. I would like the website url to be a hyperlink that opens into a new window but so far i've had no luck with it.
Below is the code that i'm using:
<?php
$con = mysql_connect("localhost","db_user","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db_name", $con);
$result = mysql_query("SELECT * FROM members");
echo "<table border='1'>
<tr>
<th>Site Address</th>
<th>Club</th>
</tr>";
while($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td><a target="_blank" href=' . $row['webaddress']}'>{$row['webaddress']}</a></td>";
echo "<td>" . $row['club'] . "</td>";
echo "</tr>";
} echo "</table>";
mysql_close($con);
?>


Sign In
Create Account


Back to top









