user2308737
user2308737

Reputation: 3

Having problems with clickable links

So here is my code:

$sql = "SELECT * FROM $tbl_name ORDER BY id DESC LIMIT $start, $limit";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
  echo "<a href =\"vicevi.php?id=$row[id]\">".$row['Title'];"</a>";
  echo "<br>";
  echo nl2br($row["VicText"]);
  echo "<hr>";
}

And I get the link vicevi.php?id=x (x=any number) but it doesn't open specific id. Can anyone help me here?

Upvotes: 0

Views: 50

Answers (2)

Dan
Dan

Reputation: 3815

echo "<a href =\"vicevi.php?id=".$row['id']."\>".$row['Title']."</a>";

Upvotes: 0

Sebas
Sebas

Reputation: 21522

echo "<a href =\"vicevi.php?id=" . $row["id"] . "\">".$row['Title'] . "</a>";

Besides the $row[id] problem you had a ; extra.

Upvotes: 1

Related Questions