$connect = mysql_connect("localhost", "username", "password");
if($connect) {
mysql_selectdb('phplogin');
$query = mysql_query("SELECT * FROM forum ORDER BY time desc");
$query2 = mysql_query("SELECT * FROM forum");
$data2 = mysql_fetch_array($query2);
$id = $data2['id'];
while($data = mysql_fetch_array($query)) {
echo "<div class='post'>" . "<div class='leftside'>" . "<h3 class='by'>" . $data['user'] . "</h3>" . "<h5 class='date'>" . $data['time'] . "</h5>" . "</div>" . "<div class='after'>" . "</div>" . "<div class='rightside'>" . "<h2 class='title'>" . "<a href='Forum.php?$id'>" . htmlspecialchars($data['title']) . "</a>" . "</h2>" . "<p class='description'>" . htmlspecialchars($data['description']) . "</p>" . "</div>" . "<div class='clear'>" . "</div>" . "</div>";
}
This is what ive tried but it assigns the first rows id to all links and i don't know how to do it, i am new to php and mysql thanks for the help in advance.