Hello, why wont this code give my "Rubrik" a link with its ID? I only get "www.yada.com/open.php?id="
<a href="skapaannons.php">Lägg till annons!
</a>
<?php
$con = mysql_connect(" "," "," ");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db("annons", $con);
$result = mysql_query("SELECT annons.id, annons.datum, annons.rubrik, annons.pris, annons.område, annons.säljare, annons.email, annons.tele, annons.kat, annons.text, områden.plats AS område FROM annons, områden WHERE annons.område=områden.id");
$id2 = mysql_query("SELECT annons.id, annons.datum, annons.rubrik, annons.pris, annons.område, annons.säljare, annons.email, annons.tele, annons.kat, annons.text, områden.plats as annons FROM annons WHERE annons.rubrik=annons.id");
echo '<h2>Annonser</h2>';
echo '<table cellpadding="2" rules="groups" frame="box">';
echo '<thead><tr><th width="150px" align="left">Datum</th><th width="350px" align="left">Rubrik</th><th width="50px" align="left">Pris</th><th width="100px" align="left">Område</th></thead>';
echo '<tbody>';
while ($add = mysql_fetch_array($result, MYSQL_BOTH)){
echo "<td>" . $add['datum'] . "</td>";
echo "<td>" . '<a href="open.php?id='.urlencode($id2).'">' . $add['rubrik'] . '</a>' . "</td>";
echo "<td>" . $add['pris'] . ":-</td>";
echo "<td>" . $add['område'] . "</td>";
echo '</tr>';
}
echo "</tbody></table>";
echo "<br \>";
echo "<br \>";
mysql_close($con);
?>