Trying to show the latest threads the user started and the latest threads a user posted in.
I'm having 2 problems with the latest a user posted in
- Don't show threads the user has started under threads a user posted in
- If a user has multiple post in one threads don't show thread multiple times
PHP Code://Mythreads Latest you started
$Recordset1 = mysql_query("SELECT * FROM `phpbb_topics` WHERE `topic_poster` = 2 ORDER BY `topic_time` DESC LIMIT 0 , 4") or die(mysql_error());
$blue = 0;
while ($results = mysql_fetch_array($Recordset1))
{
$id[$blue] = $results[topic_id];
$title[$blue] = $results[topic_title];
$blue++;
if ($blue == 5) break;
}
echo "Threads you started:<br>";
$blue = 0;
while ($blue < 4) {
echo "<a href=\"http://www.top-download.net/forum/viewtopic.php?t=$id[$blue]\">$title[$blue]</a><br>";
$blue++;
}
//Mythreads Latest you posted in
$Recordset1 = mysql_query("SELECT * FROM `phpbb_posts` WHERE `poster_id` = 2 ORDER BY `post_time` DESC LIMIT 0 , 4") or die(mysql_error());
$blue = 0;
while ($results = mysql_fetch_array($Recordset1))
{
$id[$blue] = $results[topic_id];
$title[$blue] = $results[topic_title];
$blue++;
if ($blue == 5) break;
}
echo "<br>Topics you posted in:<br>";
$blue = 0;
while ($blue < 4) {
echo "<a href=\"http://www.top-download.net/forum/viewtopic.php?t=$id[$blue]\">topic$blue</a><br>";
$blue++;
}




Bookmarks