lilleman, I think the tid is the id field...
$lsql = "SELECT date,author FROM threads WHERE tid='$topic_id' ORDER BY tid DESC LIMIT 1";
pinehead18, you could also ORDER it by the date too.
$lsql = "SELECT date,author FROM threads WHERE tid='$topic_id' ORDER BY date DESC LIMIT 1";